Unspecified error on recordset open

Unspecified error on recordset open

Post by Greg » Thu, 04 Nov 2004 07:15:33


Hi, please help me!

I'm connecting to my database using...

Database_ConnectionString = "Provider=Microsoft.JET.OLEDB.4.0;Data
Source="&server.mappath("/db/db127/store.mdb")
set con=Server.CreateObject("ADODB.Connection")
con.open(Database_ConnectionString)




I'm assuming this is correct as no errors occur on these lines.
I then want to get 4 recordsets, the first two "welcome" and "featured" are
opened without a problem using the following:

Set welcome = Server.CreateObject( "ADODB.Recordset" )
welcome.ActiveConnection = con
sqlString = "SELECT * FROM welcome WHERE Key=1"
welcome.Open sqlString

Set featured = Server.CreateObject( "ADODB.Recordset" )
featured.ActiveConnection = con
sqlString = "SELECT * FROM featured Order By Key"
featured.Open sqlString




However, the next two recordsets "topten" and "cat" I use the following code
for, but they give me an unspecified error number 80004005 on the line that
opens them... whatever.Open sqlString. The format of this code is exactly
the same as the previous, so why won't it work?

Set topten = Server.CreateObject( "ADODB.Recordset" )
topten.ActiveConnection = con
sqlString = "SELECT * FROM topten Order By Position"
topten.Open sqlString

Set cat = Server.CreateObject( "ADODB.Recordset" )
cat.ActiveConnection = con
sqlString = "SELECT * FROM categories Where SubCatOf = 0 Order By Position"
cat.Open sqlString




The database tables are as follows:
topten("Position" - primary key, numeric
"Code" - text
"Text" - text)
categories("CatNo" - primary key, text
"CatName" - text
"SubCatOf" - numeric
"Position" - text)
welcome("Key" - primary key, numeric
"Picture" - text
"Title" - text
"Message" - memo)
featured("Key" - primary key, numeric
"Title" - text
"Pic" - text
"Text" - memo)



I just can't understand why some of it works and the rest doesn't?! Any help
would be much appreciated, many thanks,
Greg.
 
 
 

Unspecified error on recordset open

Post by Aaron [SQL » Thu, 04 Nov 2004 07:46:31

This looks like a problem with an Access database. Might I suggest
microsoft.public.inetserver.asp.db as opposed to
microsoft.public.sqlserver.programming ?

--
http://www.yqcomputer.com/
(Reverse address to reply.)






are
code
that
Position"
help

 
 
 

Unspecified error on recordset open

Post by Jeff Dillo » Thu, 04 Nov 2004 10:07:16

Does it matter which order you put the sql statements in?

What if you remove the ORDER BY clause?

Jeff


are
code
that
Position"
help
 
 
 

Unspecified error on recordset open

Post by Greg » Thu, 04 Nov 2004 10:18:49

f I remove the Order By Position clause from the two statements I'm having
trouble with, it works a little faster, but not that much faster! It seems
to make no difference what order I put the statements in. Would it be due to
the table size? Or maybe the way I'm connecting to the database? Or is the
server I'm hosting on just really slow?!

Thanks,
Greg

"Jeff Dillon" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...
exactly


 
 
 

Unspecified error on recordset open

Post by Jeff Dillo » Fri, 05 Nov 2004 02:16:15

irst you said you got an error message, and now you're saying it's just
slow?? Which is it??

Jeff
"Greg" < XXXX@XXXXX.COM > wrote in message
news: XXXX@XXXXX.COM ...
having
to
"featured"
following
line
Any