Connecting Tech Pros Worldwide Help | Site Map

UPDATE statement

Newbie
 
Join Date: Mar 2007
Posts: 1
#1: Mar 8 '07
hie guys, im having trouble with updating an access database. Here is my code below. userAns and QuesNo are fields in the database and userAns and ques are variables that I have declared and will get values from textboxes etc. For some reason the details are not being updated into the database

Expand|Select|Wrap|Line Numbers
  1. Dim objConn As New OleDbConnection _
  2.             ("Provider=Microsoft.Jet.OLEDB.4.0;" & _
  3.             "User ID=Admin;" & _
  4.             "Data Source=db2.mdb")
  5.         objConn.Open()
  6.  
  7.         Dim objAdapter As New OleDbDataAdapter
  8.         objAdapter.UpdateCommand = New OleDbCommand( _
  9.             "UPDATE Ques_Table SET userAns= '" & userAns & "' Where QuesNo ='" & ques & "'", objConn)
  10.  
  11.         objConn.Close()
Lives Here
 
Join Date: Oct 2006
Posts: 1,626
#2: Mar 8 '07

re: UPDATE statement


Hi what is the data type of userAns and QuesNo in the database?
Reply