I am trying to write an SQL INSERT INTO statement to insert data into a table in MS Access. The method I am writing is accepting an object and then getting the specific information needed to insert into the database out of the object. I have having trouble with the wording of the SQL statement itself and I would appreciate any help. int qID String qText boolean qType int qCorrect sql = "INSERT INTO Question(qID, qText, qType, qCorrect) VALUES(+qID, +"qText", + qType, + qCorrect)");
I also need to write an UPDATE statment based on the same idea, where the method will be sent an object. Could someone give me an example of how the sql statement will look? Thanx again!!!
Originally posted by Kassi Hill: Would the update statement be the same excet using UPDATE instead of INSERT INTO??
No. The UPDATE query will look like this UPDATE table_name SET column_name = value Be sure to add a WHERE clause, so that only the corresponding row(s) will be updated. Else you will end up updating all the rows in the table. The syntax will be UPDATE table_name SET column_name = value WHERE condition [ October 15, 2003: Message edited by: Prasma Kankut ]
<i>The fact that today we know more than yesterday is good news about today, not bad news about yesterday - Ilja Preuss</i>
Joined: Sep 29, 2003
Thanx again for your help. If I understand correctly, my Upate statement should look something like: