Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

updating access database

Status
Not open for further replies.

michelleHEC

Programmer
Oct 20, 2003
95
US
my update command is not working. can anyone see what the problem is? I am not getting an error...

Dim cnTag1 As New OleDb.OleDbConnection
cnTag1.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Password=;User ID=Admin;data source=c:\BlownAway.db.mdb"
Dim sqlTag1 As String = "Update Supply set Quantity = ? where SupplyID = ? "
Dim cmTag1 As New OleDb.OleDbCommand(sqlTag1, cnTag1)
cmTag1.Parameters.Add(New OleDb.OleDbParameter("SupplyID", OleDb.OleDbType.VarChar, 50))
cmTag1.Parameters.Add(New OleDb.OleDbParameter("Quantity", OleDb.OleDbType.Integer, 4))
cmTag1.Parameters("SupplyID").Value = strSupplyID
cnTag1.Open()
cmTag1.Parameters("Quantity").Value = dblShirtT
cmTag1.ExecuteReader()
cnTag1.Close()
Thank you in advance.
 
ok, I solved it by looking back at some old questions. I put the values right in the statement instead of using parameters and it worked.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top