|
 |
asp_database_setup thread: ADODB.Recordset (0x800A0BB9)
Message #1 by "Ender Wiggin" <mazthe@y...> on Fri, 2 Nov 2001 07:19:21
|
|
I've been following the Writing an Application example in the Beginning
asp 3.0 book, changing certain file names and certain variables according
to my own SQL Server 7 db. I?ve had an error that I cant explain. I've had
a re-read of lots of sections, but I cant work it out. I've also had a
look on wrox site at the book errata as I thought it may be something
which other developers have encountered, and I?ve looked through the forum
and tried the suggested links.
my include file contains
reference to the ADO typelib (msado15.dll)
all the connection information necessary
and a login check
When I run a the page in the browser I get the following error:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.
/begASP/ViewDocs.asp, line 31
which is accociated with this code:
Dim rsDocs
Set rsDocs = Server.CreateObject("ADODB.Recordset")
rsDocs.Filter = "personID = " & Session("personID")
rsDocs.Open "tDocumentation", objConn, adOpenForwardOnly,
adLockOptimistic, adCmdTable
I changed the code by replacing the code above with the following and it
works!
Dim rsDocs
Set rsDocs = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM tDocumentation WHERE personID LIKE '" & Session
("personID") & "';"
rsDocs.Open strSQL, objConn
nb: strSQL is declared in the include file
So I?ve got a fix, but I?m wondering why the example (from the book) using
the Filter method doesn?t work? What am I missing?
Hope someone can help.
Message #2 by "Ken Schaefer" <ken@a...> on Fri, 2 Nov 2001 20:26:35 +1100
|
|
In your second bit of code you have:
LIKE '" & Session("PersonID") & "'"
(note the use of ' marks)
In your first piece of code, you don't have these...
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Ender Wiggin" <mazthe@y...>
Subject: [asp_database_setup] ADODB.Recordset (0x800A0BB9)
: I've been following the Writing an Application example in the Beginning
: asp 3.0 book, changing certain file names and certain variables according
: to my own SQL Server 7 db. I?ve had an error that I cant explain. I've had
: a re-read of lots of sections, but I cant work it out. I've also had a
: look on wrox site at the book errata as I thought it may be something
: which other developers have encountered, and I?ve looked through the forum
: and tried the suggested links.
:
: my include file contains
: reference to the ADO typelib (msado15.dll)
: all the connection information necessary
: and a login check
:
: When I run a the page in the browser I get the following error:
:
: ADODB.Recordset (0x800A0BB9)
: Arguments are of the wrong type, are out of acceptable range, or are in
: conflict with one another.
: /begASP/ViewDocs.asp, line 31
:
: which is accociated with this code:
:
: Dim rsDocs
: Set rsDocs = Server.CreateObject("ADODB.Recordset")
: rsDocs.Filter = "personID = " & Session("personID")
: rsDocs.Open "tDocumentation", objConn, adOpenForwardOnly,
: adLockOptimistic, adCmdTable
:
: I changed the code by replacing the code above with the following and it
: works!
:
: Dim rsDocs
: Set rsDocs = Server.CreateObject("ADODB.Recordset")
: strSQL = "SELECT * FROM tDocumentation WHERE personID LIKE '" & Session
: ("personID") & "';"
: rsDocs.Open strSQL, objConn
:
: nb: strSQL is declared in the include file
:
: So I?ve got a fix, but I?m wondering why the example (from the book) using
: the Filter method doesn?t work? What am I missing?
:
: Hope someone can help.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message #3 by "Ender Wiggin" <mazthe@y...> on Fri, 9 Nov 2001 06:08:37
|
|
Thanks Ken,
As you can probably tell I'm new to this. I tryed a number of
alternatives using quotes and inverted commas. This one works:
rsDocs.Filter = "personID = '" & Session("personID") &"'"
Thanks again for the help.
> In your second bit of code you have:
>
> LIKE '" & Session("PersonID") & "'"
>
> (note the use of ' marks)
>
> In your first piece of code, you don't have these...
>
> Cheers
> Ken
|
|
 |