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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error '800a0e7d' 1

Status
Not open for further replies.

Webflex

Technical User
Apr 20, 2001
101
GB
Hi Me Again!

The following connection

Code:
<%@LANGUAGE=&quot;VBSCRIPT&quot;%>
<%
dsn=&quot;DBQ=&quot; & Server.Mappath(&quot;db/csoprojects.mdb&quot;) & &quot;;Driver={Microsoft Access Driver (*.mdb)};&quot;
set conn = server.createObject(&quot;adodb.connection&quot;)
set RsLastRec = Server.CreateObject(&quot;ADODB.Recordset&quot;)
conn.open dsn
RsLastRec.Source = &quot;SELECT *  FROM users  ORDER BY id DESC&quot;
RsLastRec.CursorType = 0
RsLastRec.CursorLocation = 2
RsLastRec.LockType = 3
RsLastRec.Open
RsLastRec_numRows = 0
%>

is giving the following error

Code:
ADODB.Recordset error '800a0e7d' 

Operation is not allowed on an object referencing a closed or invalid connection. 

/globalapps/project/copyfinalrec.asp, line 11

As ususal any help is much appreciated.

TIA
Webflex
 
You don't specify an active connection for the Recordset
You need to add something like:

set RsLastRec.ActiveConnection = conn Mise Le Meas,

Mighty :)
 
Thanks

tried this

Code:
<%@LANGUAGE=&quot;VBSCRIPT&quot;%>
<%
dim dsn,RsLastRec
dsn=&quot;DBQ=&quot; & Server.Mappath(&quot;db/csoprojects.mdb&quot;) & &quot;;Driver={Microsoft Access Driver (*.mdb)};&quot;
set conn = server.createObject(&quot;adodb.connection&quot;)
set RsLastRec.ActiveConnection = conn 
conn.open dsn
RsLastRec.Source = &quot;SELECT *  FROM users  ORDER BY id DESC&quot;
RsLastRec.CursorType = 0
RsLastRec.CursorLocation = 2
RsLastRec.LockType = 3
RsLastRec.Open
RsLastRec_numRows = 0
%>

got this

Code:
Microsoft VBScript runtime error '800a01a8' 

Object required: '' 

/globalapps/PROJECT/copyfinalrec.asp, line 6

I guess I'm missing something simple here....
 
You still need to create the recordset object and you need to open the connection first:

<%@LANGUAGE=&quot;VBSCRIPT&quot;%>
<%
dim dsn,RsLastRec
dsn=&quot;DBQ=&quot; & Server.Mappath(&quot;db/csoprojects.mdb&quot;) & &quot;;Driver={Microsoft Access Driver (*.mdb)};&quot;

set conn = server.createObject(&quot;adodb.connection&quot;)
conn.open dsn

set RsLastRec = Server.CreateObject(&quot;ADODB.Connection&quot;)
set RsLastRec.ActiveConnection = conn

RsLastRec.Source = &quot;SELECT * FROM users ORDER BY id DESC&quot;
RsLastRec.CursorType = 0
RsLastRec.CursorLocation = 2
RsLastRec.LockType = 3
RsLastRec.Open
RsLastRec_numRows = 0

Let me know if that works. Mise Le Meas,

Mighty :)
 
Sorry mistake:

<%@LANGUAGE=&quot;VBSCRIPT&quot;%>
<%
dim dsn,RsLastRec
dsn=&quot;DBQ=&quot; & Server.Mappath(&quot;db/csoprojects.mdb&quot;) & &quot;;Driver={Microsoft Access Driver (*.mdb)};&quot;

set conn = server.createObject(&quot;adodb.connection&quot;)
conn.open dsn

set RsLastRec = Server.CreateObject(&quot;ADODB.Recordset&quot;)
set RsLastRec.ActiveConnection = conn

RsLastRec.Source = &quot;SELECT * FROM users ORDER BY id DESC&quot;
RsLastRec.CursorType = 0
RsLastRec.CursorLocation = 2
RsLastRec.LockType = 3
RsLastRec.Open
RsLastRec_numRows = 0

Mise Le Meas,

Mighty :)
 
Worked like a charm...

Thanks Mighty
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top