Hi,everyone
In ASP I'm trying to run a Query in Access, here is the code:
<%set conn = server.createobject("adodb.connection"
conn.open "WEBORDER"
set cmd=server.createobject("adodb.command"
set cmd.Activeconnection=conn
cmd.Commandtext="Qlist1"
set rs=cmd.execute()
.......%>
I got error message like this:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'
if I run this Query in access,it works well, in Access the QList1 is:
SELECT QLastIN.JobNum, QLastIN.Lastdate, Max(FeedBack.SendDate) AS MaxOfSendDate
FROM FeedBack RIGHT JOIN QLastIN ON FeedBack.Jobnum = QLastIN.JobNum
GROUP BY QLastIN.JobNum, QLastIN.Lastdate;
To find out the problem,I replace Qlist1 by another Query(QlastIN),Asp works well. I think the problem cause by Qlist1,but in Access it works!
Any thoughts about it?
In ASP I'm trying to run a Query in Access, here is the code:
<%set conn = server.createobject("adodb.connection"
conn.open "WEBORDER"
set cmd=server.createobject("adodb.command"
set cmd.Activeconnection=conn
cmd.Commandtext="Qlist1"
set rs=cmd.execute()
.......%>
I got error message like this:
Error Type:
Microsoft OLE DB Provider for ODBC Drivers (0x80040E14)
[Microsoft][ODBC Microsoft Access Driver] Invalid SQL statement; expected 'DELETE', 'INSERT', 'PROCEDURE', 'SELECT', or 'UPDATE'
if I run this Query in access,it works well, in Access the QList1 is:
SELECT QLastIN.JobNum, QLastIN.Lastdate, Max(FeedBack.SendDate) AS MaxOfSendDate
FROM FeedBack RIGHT JOIN QLastIN ON FeedBack.Jobnum = QLastIN.JobNum
GROUP BY QLastIN.JobNum, QLastIN.Lastdate;
To find out the problem,I replace Qlist1 by another Query(QlastIN),Asp works well. I think the problem cause by Qlist1,but in Access it works!
Any thoughts about it?