ASP/SQL error message

M

Micromanaged

Getting the following error message:

Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.
/safedevelopment/Credit/FairIsaac.asp, line 20

From this code:
Set cn = Session("cnn")
Set rstPhones = Server.CreateObject("ADODB.Recordset")

'CID = Session("CID")
'SID = Session("SID")

if ID > -1 then
set SQL= cn.Execute("SELECT Customers.[Company Name],
Customers.[Address Line 1], " & _
"Customers.[Address Line 2], Customers.City, Customers.State,
Customers.Zip, " & _
"Customers.[Company Phone],Customers.[Business Structure]FROM Customers
INNER JOIN Schedule on " & _
"Customers.[ID]=Schedule.[customer id]")

rstPhones.Open SQL, cn, adOpenDynamic, , adCmdText
end if

Ideas? Pointers? Tips? on what I am doing wrong would be appreciated.

Thanks in advance.
 
M

Mike

VB script doesn't know what VB constants are, so it doesn't know what
'adOpenDynamic' is supposed to mean.
make an #include to 'adovbs.inc' or use the number constant instead of the
variable.
 
A

Aaron [SQL Server MVP]

set SQL= cn.Execute("...

Here you have a recordset object
rstPhones.Open SQL, cn, adOpenDynamic, , adCmdText

The open statement doesn't expect a recordset object where you've placed it.
Replace the two above lines with:

set rstPhones = cn.Execute("...

And drop the Server.CreateObject("ADODB.Recordset") line.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top