Okay, hi everyone. I am trying to get this ODBC-Access thing working, but it seems to be really picky (or I may just be working in the dark). Anyway, the problem is that I am getting an error code telling me that I am not passing enough arguments to objConn.Execute, and that it expects one argument. I am passing it strSQL, as you can see below.
Can anyone point me in the right direction? Oh, below is the code and the output. objConn.Execute(strSQL) is on the line it is complaining about - line 17.
Script Code ------------------------------------------------
<% @LANGUAGE = VBScript %>
<%
Response.write "Hi<br><BR>"
Response.Expires = 0
strQuery = "SELECT * FROM (CUSTOMER INNER JOIN ORDITEMS ON CUSTOMER.ORDERNO=ORDITEMS.ORDERNO) INNER JOIN ORDERS ON CUSTOMER.ORDERNO=ORDERS.ORDERNO WHERE CUSTOMER.ORDERNO=" & chr(34) & "003000" & chr(34) & " ORDER BY CUSTOMER.ORDERNO"
'Making sure it does hold something
'Because of the error message
Response.write strQuery
strConnection="DSN=XXXX;Database=XXXX;"
strConnection=strConnection & "UID=username;PWD=password"
Set objConn = Server.CreateObject("ADODB.Connection"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
objConn.Open strConnection
Set objRS = objConn.Execute(strQuery)
count = 1
While Not objRS.EOF
'Just trying to see if it returns anything, and if so, how
'many records
Response.write count & "<br>" & vbcrlf
count = count + 1
objRS.MoveNext
Wend
objRS.close
objConn.close
set objRS = nothing
set objConn = nothing
%>
Script Output ---------------------------------------------
SELECT * FROM (CUSTOMER INNER JOIN ORDITEMS ON CUSTOMER.ORDERNO=ORDITEMS.ORDERNO) INNER JOIN ORDERS ON CUSTOMER.ORDERNO=ORDERS.ORDERNO WHERE CUSTOMER.ORDERNO="003000" ORDER BY CUSTOMER.ORDERNO
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
/import.asp, line 17
------------------------------------------------------------
Where line 17 has the objConn.Execute line on it. Thanks ahead of time for any help.
Thanks,
Corey Tisdale
Can anyone point me in the right direction? Oh, below is the code and the output. objConn.Execute(strSQL) is on the line it is complaining about - line 17.
Script Code ------------------------------------------------
<% @LANGUAGE = VBScript %>
<%
Response.write "Hi<br><BR>"
Response.Expires = 0
strQuery = "SELECT * FROM (CUSTOMER INNER JOIN ORDITEMS ON CUSTOMER.ORDERNO=ORDITEMS.ORDERNO) INNER JOIN ORDERS ON CUSTOMER.ORDERNO=ORDERS.ORDERNO WHERE CUSTOMER.ORDERNO=" & chr(34) & "003000" & chr(34) & " ORDER BY CUSTOMER.ORDERNO"
'Making sure it does hold something
'Because of the error message
Response.write strQuery
strConnection="DSN=XXXX;Database=XXXX;"
strConnection=strConnection & "UID=username;PWD=password"
Set objConn = Server.CreateObject("ADODB.Connection"
objConn.Open strConnection
Set objRS = objConn.Execute(strQuery)
count = 1
While Not objRS.EOF
'Just trying to see if it returns anything, and if so, how
'many records
Response.write count & "<br>" & vbcrlf
count = count + 1
objRS.MoveNext
Wend
objRS.close
objConn.close
set objRS = nothing
set objConn = nothing
%>
Script Output ---------------------------------------------
SELECT * FROM (CUSTOMER INNER JOIN ORDITEMS ON CUSTOMER.ORDERNO=ORDITEMS.ORDERNO) INNER JOIN ORDERS ON CUSTOMER.ORDERNO=ORDERS.ORDERNO WHERE CUSTOMER.ORDERNO="003000" ORDER BY CUSTOMER.ORDERNO
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.
/import.asp, line 17
------------------------------------------------------------
Where line 17 has the objConn.Execute line on it. Thanks ahead of time for any help.
Thanks,
Corey Tisdale