Forums

This topic is locked

error '80004005' - error in your SQL syntax

Posted 30 Jul 2002 03:21:08
1
has voted
30 Jul 2002 03:21:08 Andrew Ross posted:
Hi,

I am trying to convert my database pages from Access to MySQL and have run into some problems with SQL syntax. I have a series of two pages that insert new records into multiple tables that have worked great with Access, but return the error below with MySQL:

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
ADODB.Connection.1 error '80004005'
SQLState: 42000
Native Error Code: 1064
[TCX][MyODBC]You have an error in your SQL syntax near ')' at line 1


/canphotodirect/insert_pg2.asp, line 102
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

This is the code that seems to be causing the problem:

<pre id=code><font face=courier size=2 id=code>
&lt;%
If Request("chkCategories" & (rsCategories.Fields.Item("Category_ID".Value)) &lt;&gt; "" Then
set Command1 = Server.CreateObject("ADODB.Command"
Command1.ActiveConnection = MM_canphoto_STRING
Command1.CommandText = "INSERT INTO ContactCategories
(Category_ID, Contact_ID) VALUES (" + Replace
(Command1__varCategories, "'", "''" + ", " + Replace
(Command1__varContact_ID, "'", "''" + " "
Command1.CommandType = 1
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()
End If
%&gt;
</font id=code></pre id=code>

If anyone can help me figure this out I would be very grateful.

Thanks,

Andrew



Edited by - arossphoto on 30 Jul 2002 04:10:59

Replies

Replied 31 Jul 2002 15:20:46
31 Jul 2002 15:20:46 Andrew Ross replied:
Can anyone recommend a better place to post this question? I really need an answer and some help with this conversion from Access to MySQL, so if this isn't the best place to ask I'd appreciate any recommendations on other resources or websites.

Thanks

Reply to this topic