Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update query?

Status
Not open for further replies.

SmileeTiger

Programmer
Mar 13, 2000
200
US
What is the format for an update query?<br><br>I tried <br>&lt;%<br>' Open Database Connection<br>Set Con = Server.CreateObject( &quot;ADODB.Connection&quot; )<br>Con.Open &quot;DSN=SN_Reg_System&quot;<br><br>' Execute the UPDATE statement<br>mySQL = &quot;UPDATE Survey SET Number='50' WHERE Name='Mac'&quot;<br>Con.Execute(mySQL)<br>%&gt;<br><br>but there seems to be something slightly wrong with it
 
:)<br><br>try this:<br><br>mySQL = &quot;UPDATE Survey SET [Number]='50' WHERE Name='Mac'&quot;<br><br>..
 
Yup that worked QUITE fine. Why did I have to use []'s though?<br><br>Cory
 
You have to use the brackets, [], because Number is a word reserved by SQL. There should be a complete list of reserved words in the help section of your database program.<br><br>HTH,<br>-Kelly
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top