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
Using a query to filter a subreport?
ForeFront TMG Intermittent Internet Connection
Replace sring on the first line and then replace ALL the following string(2 to eof)
Trouble setting treeview width
Dot Net Written Test and Interview questions, Can any 1 suggest link
How do I create a class that handles file I/O for a car rental reservation program?
VBA Excel - selecting Control Toolbox/Image
VB.net 32bit&64bit COM Refereces?
The object invoked has disconnected from its clients.
Problem with file name comparison in unix script