TheWizardofInt
Well-known member
This code:
Gives me a must use updareable query error.
What I am doing is updating an Access database called GMVars, Table Vars, with a new Login and Pwd to let a new person into my site
Code:
Dim sName As String = txtLogin.Text
Dim sPwd As String = txtPwd.Text
Dim MyConnection As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("database/GMVar.mdb") & ";")
MyConnection.Open()
Dim MyCommand As New OleDb.OleDbCommand("SELECT [AUTOID] FROM [VARS] WHERE Login=" & sName & " AND " & _
"pwd=" & sPwd & "", MyConnection)
Dim MyReader As OleDb.OleDbDataReader = MyCommand.ExecuteReader()
If MyReader.Read Then
lblAnnounce.Text = MyReader.GetString(0)
MyConnection.Close()
Exit Sub
End If
MyReader.Close()
MyCommand.Dispose()
Dim sval As String = "Insert Into [VARS] (Login, Pwd) Values(" & sName & ", " & sPwd & ")"
MyCommand = New OleDb.OleDbCommand("Insert Into [VARS] ([Login], [Pwd]) Values(" & sName & ", " & sPwd & ")", MyConnection)
MyCommand.ExecuteNonQuery()
MyConnection.Close()
MyCommand.Dispose()
Gives me a must use updareable query error.
What I am doing is updating an Access database called GMVars, Table Vars, with a new Login and Pwd to let a new person into my site