Microsoft
Software
Hardware
Network
Question : using Update procedure to update a table in Access database
Hi,
Can you help me find the error in the following code:
I use the code to update the counter field in a table called Survey in a database also called Survey.
NewCount is an integer variable which stores the value I need to save in the counter field.
Dim con As OleDbConnection
Dim comm As OleDbCommand
Dim strQuery As String
strQuery = "Update Survey set counter = newCount Where SurveyName = '" & lblSurveyName.Text & "'"
con = New OleDbConnection("Provider=
Microsoft.
ACE.OLEDB.
12.0;Data Source=C:\Survey.accdb;")
comm = New OleDbCommand(strQuery, con)
con.Open()
comm.ExecuteNonQuery()
con.Close()
Answer : using Update procedure to update a table in Access database
how about this
strQuery = "Update Survey set [counter] =" & newCount &" Where SurveyName = '" & lblSurveyName.Text & "'"
or this
strQuery = "Update Survey set [counter] =" & newCount &" Where SurveyName = '" & lblSurveyName & "'"
Random Solutions
Mail delivery has failed
Adobe - monitor profile [..] appears to be defective. Please rerun your monitor calibration software
OS X Server 10.5 and OS X Laptops Joining accounts to Open Directory?
Email is being received but cannot send out
Juniper Network Connect won't reconnect after forced logout
Count number of occurances in a string
vlan isolation - need to keep a vlan from seeing network
How do I mount a partition in deft linux?
Windows 2k8 R2 Remote Desktop Services keeps disconnecting users
iMac Snow Leopard Mouse pointer jitter and always go back to upper left corner