Using ASP.NET to update Access Database - TechRepublic
General discussion
February 17, 2004 at 03:48 AM
davebyrne

Using ASP.NET to update Access Database

by davebyrne . Updated 22 years, 3 months ago

Hi all,

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

This discussion is locked

All Comments