General discussion
Thread display: Collapse - |
All Comments
Start or search
Create a new discussion
If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.
Using ASP.NET to update Access Database
I'm new to ASP.NET and I am trying to get it to update an access database. The problem I am having is that whenever I try to pass the following SQL I get the error "Syntax error in UPDATE statement". Can anyone see what would cause this?
code:
Sub submit(sender As Object, e As System.EventArgs)
Dim MyConnection As OleDbConnection
MyConnection = New OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;DATA SOURCE=" & server.mappath("internal.mdb") & ";")
Dim MyCommand As OleDbCommand
Dim UpdateCmd As String = "UPDATE login SET password = 'Hello'"
MyCommand = New OleDbCommand(UpdateCmd, MyConnection)
MyCommand.Connection.Open()
MyCommand.ExecuteNonQuery()
MyCommand.Connection.Close()
End Sub