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!

Syntax Error, Cant Find It

Status
Not open for further replies.

catalystunderx

Programmer
May 17, 2003
13
GB
sqlString = "INSERT INTO Products ( ProductName, ProductCode, UnitPrice, Desc, Download, Weight, DownloadLink, UnitsInStock, ProductCategory, ImageFront, ImageBack, ImageZoom ) VALUES ( " &_
" '" & ProductName & "', " &_
" '" & ProductCode & "', " &_
UnitPrice & ", " &_
" '" & Desc & "', " &_
" '" & Download & "', " &_
Weight & ", " &_
" '" & DownloadLink & "', " &_
UnitsInStock & ", " &_
" '" & ProductCategory & "', " &_
" '" & ImageFront & "', " &_
" '" & ImageBack & "', " &_
" '" & ImageZoom & "'"" )
 
It doesn't look as if there's any space between your ampersand and your line continuation character at the end of your lines; there has to be. Change this: (&_) to this:
(& _) and it should work fine

bdiamond
 
...and remove the extra double quotes at the end...

sqlString = "INSERT INTO Products ( ProductName, ProductCode, UnitPrice, Desc, Download, Weight, DownloadLink, UnitsInStock, ProductCategory, ImageFront, ImageBack, ImageZoom ) VALUES ( " & _
" '" & ProductName & "', " & _
" '" & ProductCode & "', " & _
UnitPrice & ", " & _
" '" & Desc & "', " & _
" '" & Download & "', " & _
Weight & ", " & _
" '" & DownloadLink & "', " & _
UnitsInStock & ", " & _
" '" & ProductCategory & "', " & _
" '" & ImageFront & "', " & _
" '" & ImageBack & "', " & _
" '" & ImageZoom & "'[red]""[/red] )"



Mark

"You guys pair up in groups of three, then line up in a circle."
- Bill Peterson, a Florida State football coach
 
thanks for the help so far but no joy!! this ones been frustrating me for a few hours now : (
 
The could be that DESC is a reserved word in whatever database you're using. Try this:

sqlString = "INSERT INTO Products ( ProductName, ProductCode, UnitPrice, [Desc], Download, Weight, DownloadLink, UnitsInStock, ProductCategory, ImageFront, ImageBack, ImageZoom )

-dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top