I’m trying to create Web Application using ASP.Net via Visual Studio 2010.
The Database that I use is Access, with connection Method OleDb
When using the query “Update” or “Delete”, the programs shows no errors, but the data in Access does not change.
While for query “Select” and “Insert”, the data is displayed and inserted successfully.
The Following code is the sample query “Delete” that I used..
Imports System.Data.OleDb
Partial Class frmTEst
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim dbConnection As OleDbConnection
Dim dbCommand As OleDbCommand
Dim sqlString As String
dbConnection = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & _ Server.MapPath("App_Data/dbKAE.mdb"))
dbConnection.Open()
sqlString = "DELETE FROM tblPengawasan WHERE no='31'"
dbCommand = New OleDbCommand(sqlString, dbConnection)
dbCommand.ExecuteNonQuery()
End Sub
End Class
Previously I tried a direct query using AccessDataSource, but the result just the same, “Update” and “Delete” can’t be done. But the “Select” and “Insert” can be executed successfully.
Is there any problem with my Access configuration or whether the problem is in the coding itself..?
Please Help..