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

runtime error '800a01a8' Object required

Status
Not open for further replies.

Andviv

Programmer
Aug 6, 2001
29
US
I have a COM .exe running in a server. The database is SQLServer.
The component is running fine if used from VB.
This class requires a connection before it can use any of its methods (see line 5)
I know that the ado connection is working fine because I can get a recordset if using a query, but when calling the method that returns a recordset I get this:

Error message:
Microsoft VBScript runtime error '800a01a8'
Object required
/demos/list.asp, line 8


1.set adocnn = server.CreateObject ("adodb.connection")
2.adocnn.Open "database","user","pwd"
3.
4.Set objtest = server.Createobject("MyObject.MyClass")
5.set objtest.adoCnn = adocnn
6.set rst = objtest.Getlist()
7.
8.If (rst.BOF and rst.EOF) Then
9. Response.Write "Error in data"
10.else
11. Response.Write &quot;<table border=1>&quot;
12. Do While Not rst.EOF
13. Response.Write &quot;<tr>&quot;
14. Response.Write &quot;<td>&quot; & rst(&quot;UserNum&quot;) & &quot;</td>&quot;
15. rst.MoveNext
16. Loop
17. Response.Write &quot;</table>&quot;
18.End If
19.rst.Close
20.Set objtest = Nothing
21.Set rst = Nothing

The method is like:

Public Function GetList() As ADODB.Recordset
Dim sql$
Dim hRs As ADODB.Recordset
Dim bRet As Boolean, vException As Variant
sql$ = &quot;select * from lists order by 1&quot;

bRet = GetDBData(sql$, hRs, vException) '--- this makes the query and returns another recordset.
If bRet Then
Set GetRouteList = hRs
End If
End Function

Any ideas? Please help me with this, I've been struggling with this for two days now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top