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
How to redirect a subdirectory to an alternate server and retain original URL
RHEL command to do an LS and have the result stop until you hit the space bar
VFP 6 - Simple Grid on Form and run reports
What is the best GUI for MySQLfor Windows and why?
DOS Batch Turnkey system for Win95
OS X 10.6.4 and Flash Player Issues
msoutlook 2007 data file do not compress
JavaScript: Uppercase First Letter of Every Word
JComboBox action commands
WordPress - header and footer navigation has suddenly dissappeared