I have created the following code in a VB project:
Dim myConnection As New ADODB.Connection
Dim myRecordset As New ADODB.Recordset
Set myConnection = New ADODB.Connection
myConnection.Open "Provider=SQLOLEDB.1;Password=abkosam;Persist Security Info=True;User ID=sa;Initial Catalog=carroll;Data Source=CARROLLRETAIL"
Set myRecordset = myConnection.Execute("SELECT * FROM Cashier WHERE Number = " & posSession.Cashier.Number)
MsgBox "my password is" & myRecordset(6)
MsgBox "my privileges are" & myRecordset(11)
myRecordset.Close
myConnection.Close
Set myConnection = Nothing
I need this modified so that instead of doing a select and returning data from the database, it changes data in a particular record via an UPDATE query. How do I go about doing this? What is the correct syntax?
Thank you,
Kevin
Dim myConnection As New ADODB.Connection
Dim myRecordset As New ADODB.Recordset
Set myConnection = New ADODB.Connection
myConnection.Open "Provider=SQLOLEDB.1;Password=abkosam;Persist Security Info=True;User ID=sa;Initial Catalog=carroll;Data Source=CARROLLRETAIL"
Set myRecordset = myConnection.Execute("SELECT * FROM Cashier WHERE Number = " & posSession.Cashier.Number)
MsgBox "my password is" & myRecordset(6)
MsgBox "my privileges are" & myRecordset(11)
myRecordset.Close
myConnection.Close
Set myConnection = Nothing
I need this modified so that instead of doing a select and returning data from the database, it changes data in a particular record via an UPDATE query. How do I go about doing this? What is the correct syntax?
Thank you,
Kevin