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

VBScript runtime error

Status
Not open for further replies.

nwt002

MIS
Jun 16, 2005
58
US
Does anyone know why the script below would return this error on my asp webpage:

Microsoft VBScript runtime error '800a01a8'

Object required: ''

/quotes_interface/Results/results_page.asp, line 99

Code:
[COLOR=red]
<%
[b][COLOR=black]line 99 Begins =>[/color][/b]objconn.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};" & "DBQ=quotes"[b][COLOR=black]<=line 99 Ends[/color][/b]

'Initialize ASP RND() function
Randomize()
intRandomNumber = Int(1000*Rnd)+1

'Return 3 random records
strSQL="SELECT TOP 3 Key, quote, Rnd(" & cstr(-1 * (intRandomNumber)) &"*Key)" & "FROM Results " & "ORDER BY 3"
%>
[/color]

' the headings
field = array ("key", "quote")
[COLOR=blue]<table width=[/color]"100%" [COLOR=blue]border=[/color]"1">
[COLOR=blue]<thead>
<tr>[/color]
[COLOR=red]        
<%
for each f in field
    Response.Write("<td><b>" & f & "</b></td>")
next%>[/color]
[COLOR=blue]
    </tr>
    </thead>
<tbody>[/color]
[COLOR=red]
<%
if rs.eof then
    Response.Write("<tr><td colspan=<" & UBound(field) & "align=left width=""100%"">No records returned.</td></tr>")
    else
    do while not rs.eof
    Response.Write("<tr>")
        for each f in field
    Response.Write("<td>" & rs(f)& "</td>")
        next
    Response.Write("</tr>")
        rs.MoveNext
        loop
    end if
    %>[/color][COLOR=blue]
    </tbody>
    </body>[/color]
 
I have also added

Dim objConn
Dim objRS

objConn = Server.CreateObject("ADODB.Connection")

before line 99 and i still get the same error.
 
I just tried adding set in front of objConn = Server.CreateObject("ADODB.Connection").

I'm not sure if that is right, but I get a different message now. The message I get now is:

' the headings field = array ("Key", "quote")
Microsoft VBScript runtime error '800a01c3'

Object not a collection

/quotes_interface/Results/results_page.asp, line 120

The code for line 120 is:

Code:
[COLOR=red]
%>[/color]

' the headings
field = array ("Key", "quote")
[COLOR=blue]<table width=[/color]"100%" [COLOR=blue]border=[/color]"1">[COLOR=blue]
	<thead>
		<tr>[/color]
[COLOR=red]		
<%
[b][COLOR=green]line 120 =>[/color][/b]for each f in field
	Response.Write("<td><b>" & f & "</b></td>")
next%>[/color][COLOR=blue]
		</tr>
		</thead>
		<tbody>[/color][COLOR=red]
<%[/color]
 
ok i also just tried adding the below code. I don't know if any of this is actually helping anything, but now i get this message:

Microsoft OLE DB Provider for ODBC Drivers error '80004005'

[Microsoft][ODBC Microsoft Access Driver]General error Unable to open registry key 'Temporary (volatile) Jet DSN for process 0x9fc Thread 0xb60 DBC 0x3277014 Jet'.

/quotes_interface/Results/results_page.asp, line 104


Code:
<%
Dim objConn
Dim objRS
set objConn=Server.CreateObject("ADODB.Connection")
[COLOR=red]Set objRS = Server.CreateObject("ADODB.Recordset")[/color]
objConn.ConnectionString="DRIVER={Microsoft Access Driver (*.mdb)};" & "DBQ=quotes;"
[COLOR=green]line 104 =>[/color][COLOR=red]objConn.Open [/color]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top