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 Wanet Telecoms Ltd 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 '800a0007'

Status
Not open for further replies.

Ragol1

Programmer
Oct 25, 2001
315
US
please help

Out of memory: 'Server.CreateObject'

/includes/sidebar/expanded.asp, line 107


set MyObjC = Server.CreateObject("ADODB.Recordset")
MyObjC.open "SELECT navbarid,status,parentid FROM NavBar where status = 1 and NavBarID = " & curNavBarID, MyDSN, adOpenStatic, adLockReadOnly
if not MyObjC.EOF then
if IsNull(MyObjC("navbarid")) then
ExpandBar = false
exit function
end if
if MyObjC("parentid") = 0 then
if MyObjC("navbarid") = curBaseParent then
ExpandBar = true
exit function
else
ExpandBar = false
exit function
end if
end if
Expandbar = Expandbar(MyObjC("parentid"), curBaseParent)
end if
end function


navbarid = Request("navbarid")
if navbarid = "" then
navbarid = 1
end if
 
Couple of things:
1. Don't use a DSN. Use the native OLE DB provider for your database.
2. You don't need a recordset object for what you are trying to accomplish. Get rid of it. Makes for less code & easier debugging.

strSql="SELECT navbarid,status,parentid FROM NavBar where " _
& " status = 1 and NavBarID = " & curNavBarID
set conn=Server.createobject("ADODB.CONNECTION")
conn.open YourConnectionString
set rs=conn.execute(strSql)
IF not rs.eof then...

3. What is this? Expandbar = Expandbar(MyObjC("parentid"), curBaseParent). A function? Are you sure it's not going into an endless loop?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top