SQL INSERT INTO and Numbers
<i><b>Originally posted by : Mike Horton (mhorton@planet.eon.net)</b></i><br />I posted this question last night and it looks like I did it a day too soon <G> so here goes again.<br /><br />I'm using a form to get information to insert into a database. I know from using Response. Write that the information passed is correct but I keep getting the following error: Syntax error in INSERT INTO statement.<br /><br />Here's my INSERT code:<br />SQLstmt = "INSERT INTO Drivers (First Name,Last Name,Country,Helmet)"<br />SQLstmt = SQLstmt & " VALUES (" <br />SQLstmt = SQLstmt & "'" & First_Name & "',"<br />SQLstmt = SQLstmt & "'" & Last_Name & "',"<br />SQLstmt = SQLstmt & "'" & Country & "',"<br />SQLstmt = SQLstmt & "'" & Helmet & "'"<br />SQLstmt = SQLstmt & ")"<br /><br />Now Country and Helmet are numbers (I've got them tied into relationships). I've used this exact same code when all the fields were text and it worked great. I've also seen where you use a # around a date so I've tried that with now success. Any help would be greatly appreciatted.<br />BTW There's also a Yes/No field in the table. Does that have to be filled and will a simple ' No ' do the trick?<br /><br />
Thanks
Ashley
|