Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Microsoft VBScript runtime error '800a01b6'

Status
Not open for further replies.

mattbold

Programmer
Oct 5, 2001
45
GB
hello,

sorry, this is probably a really basic problem, but i keep getting this error from my ASP page, along with "Object doesn't support this property or method: 'BOF'" ,

my code for the section it keeps getting stuck on is:

If RS.BOF And RS.EOF Then
Response.Write "There are 0 records."
Else
RS.MoveFirst
while Not RS.EOF
Response.write(&quot;<h1>&quot;&RS(&quot;ShopName&quot;)&&quot;</h1><br>&quot;)
Response.write(RS(&quot;Address1&quot;))

RS.MoveNext
Wend
End If

when i comment out the lines involving &quot;BOF&quot; or &quot;EOF&quot;, it gets stuck on the RS.MoveFirst and RS.MoveNext lines...
if anyone could help i would most appreciate it!

cheers,
matt
 
try
If RS.EOF Then
Response.Write &quot;There are 0 records.&quot;
Else
while Not RS.EOF
Response.write(&quot;<h1>&quot;&RS(&quot;ShopName&quot;)&&quot;</h1><br>&quot;)
Response.write(RS(&quot;Address1&quot;))
RS.MoveNext
Wend
End If

I dare to learn more
admin@onpntwebdesigns.com
 
woops, I forgot to stick it back in there. jsut switch them around like this
If RS.EOF And RS.BOF Then
Response.Write &quot;There are 0 records.&quot;
Else
while Not RS.EOF
Response.write(&quot;<h1>&quot;&RS(&quot;ShopName&quot;)&&quot;</h1><br>&quot;)
Response.write(RS(&quot;Address1&quot;))
RS.MoveNext
Wend
End If I dare to learn more
admin@onpntwebdesigns.com
 
hi,

thanks for such a prompt reply, but it's still getting stuck with the same error &quot;Object doesn't support this property or method: 'EOF'&quot;. :(

- matt
 
hmmm. can you post the connection to the DB. I'm certain the syntax for that is perfect and think it may be a connection issue. Once and a while I've seen that error occasionaly caused by the BOF being in front of the EOF. that's why I tried that first. o'well I dare to learn more
admin@onpntwebdesigns.com
 
Try using RS.Fields(&quot;<fieldname>&quot;) syntax for field name reference.
 
yep no worries, here's the whole ASP section with connection etc...

<%

DIM DBConn

Set DBConn = Server.CreateObject(&quot;ADODB.Connection&quot;)
MdbFilePath = Server.MapPath(&quot;stores.mdb&quot;)
DBConn.Open &quot;Driver={Microsoft Access Driver (*.mdb)}; DBQ=&quot; & MdbFilePath & &quot;;&quot;

SQL = &quot;SELECT * FROM tblStores where Region = '&quot; & request.querystring(&quot;region&quot;) & &quot;'&quot;

Set RS=server.CreateObject(&quot;Adodb.recordset&quot;)

RS = DBConn.execute(SQL)

If RS.EOF and RS.BOF Then
Response.Write &quot;There are 0 records.&quot;
Else

While Not RS.EOF
Response.write(&quot;<h1>&quot;&RS(&quot;ShopName&quot;)&&quot;</h1><br>&quot;)
Response.write(RS(&quot;Address1&quot;))

RS.MoveNext
Wend
End If

%>
 
Falcon99:

i've changed how you suggested but still no luck :(

cheers,
matt
 
Try changing these two line:
Code:
Set RS=server.CreateObject(&quot;Adodb.recordset&quot;)    
RS = DBConn.execute(SQL)
To this:
Code:
Set RS = DBConn.execute(SQL)

That may work out better for you :)
This way you are setting it equal to the object that is being returned from the execution rather than instantiating it and then allowing the server to resolve the type during assignment. My guess is that it is getting switched to a variant type which is why it says you can't check EOF or BOF, those methods don't exist for variants.
Have to love loosely typed languages.

-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
 
splendid stuff!

thanks for all your help it's working now :)

- matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top