473,396 Members | 2,023 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Out of memory: 'Server.CreateObject'

Hi group!

I am getting the following error from my ASP application:
Microsoft VBScript runtime error '800a0007'

Out of memory: 'Server.CreateObject'

It always (as far as i have observed) occurs when i try to create a new
ADODB.connection object in my cCon helper function (opening a connection and
returning it):

Function cCon()
Dim cnRet
set cnRet = server.createobject("ADODB.Connection") 'This is where the
error is thrown
cnRet.connectionstring = GLB_CONSTR_DB
cnRet.open
Set cCon = cnRet
End Function
The page that errors will typically call this function 6- 10times from
different functions which handle their connections in this way:

Function Foo()
dim Con ...
Set con = cCon()
.... function code
con.close
set con = nothing
End Function

All my recordsets are disconnected and also destroyed with .close and Set
rst = nothing.

I have tested the application on two seperate servers with the same result.

Both machines had more than enough memory.

I have also checked the application log to see if anything was logged, but
there wasnt.

Any one got ANY ideas on this one? I'm starting to get desperate!



Jul 19 '05 #1
4 14901
Peter
Looks to me like every time you call cCon() you create an object *cnRet* but
it is never destroyed. In function foo() you create another object *con*
which is destroyed on completion, but I doubt that that destruction will
cascade back to *cnRet*.

If it is not a rude question - why use a helper function to create an
ADODB.connection object? It is a straightforward action unlike a Win32 API
call for example.

HTH

Peter
"Peter Koller" <pe**********@systeam.no> wrote in message
news:ey**************@TK2MSFTNGP10.phx.gbl...
Hi group!

I am getting the following error from my ASP application:
Microsoft VBScript runtime error '800a0007'

Out of memory: 'Server.CreateObject'

It always (as far as i have observed) occurs when i try to create a new
ADODB.connection object in my cCon helper function (opening a connection and returning it):

Function cCon()
Dim cnRet
set cnRet = server.createobject("ADODB.Connection") 'This is where the
error is thrown
cnRet.connectionstring = GLB_CONSTR_DB
cnRet.open
Set cCon = cnRet
End Function
The page that errors will typically call this function 6- 10times from
different functions which handle their connections in this way:

Function Foo()
dim Con ...
Set con = cCon()
.... function code
con.close
set con = nothing
End Function

All my recordsets are disconnected and also destroyed with .close and Set
rst = nothing.

I have tested the application on two seperate servers with the same result.
Both machines had more than enough memory.

I have also checked the application log to see if anything was logged, but
there wasnt.

Any one got ANY ideas on this one? I'm starting to get desperate!


Jul 19 '05 #2
Won't the local "pointer" cnRet be destroyed when it goes out of scope?
Anyways, the reason for cCon() is lazyness, one line instead of three..

I tried to "manually" open the connections in my functions without using
cCon(), but i still error, atlhough this time when reading a session
variable (i only have one session variable holding an int so its not that
either).
In perfmon i have at least 200mb of free memory at all times. The maximum
amount of connections to my sql server is 6.


"Peter James" <ow****@yahoo.co.uk> skrev i melding
news:bf**********@codas.jet.uk...
Peter
Looks to me like every time you call cCon() you create an object *cnRet* but it is never destroyed. In function foo() you create another object *con*
which is destroyed on completion, but I doubt that that destruction will
cascade back to *cnRet*.

If it is not a rude question - why use a helper function to create an
ADODB.connection object? It is a straightforward action unlike a Win32 API call for example.

HTH

Peter
"Peter Koller" <pe**********@systeam.no> wrote in message
news:ey**************@TK2MSFTNGP10.phx.gbl...
Hi group!

I am getting the following error from my ASP application:
Microsoft VBScript runtime error '800a0007'

Out of memory: 'Server.CreateObject'

It always (as far as i have observed) occurs when i try to create a new
ADODB.connection object in my cCon helper function (opening a connection

and
returning it):

Function cCon()
Dim cnRet
set cnRet = server.createobject("ADODB.Connection") 'This is where the
error is thrown
cnRet.connectionstring = GLB_CONSTR_DB
cnRet.open
Set cCon = cnRet
End Function
The page that errors will typically call this function 6- 10times from
different functions which handle their connections in this way:

Function Foo()
dim Con ...
Set con = cCon()
.... function code
con.close
set con = nothing
End Function

All my recordsets are disconnected and also destroyed with .close and Set rst = nothing.

I have tested the application on two seperate servers with the same

result.

Both machines had more than enough memory.

I have also checked the application log to see if anything was logged, but there wasnt.

Any one got ANY ideas on this one? I'm starting to get desperate!



Jul 19 '05 #3
Peter
Perhaps you should read Aaron Bertrand's many posts on the subject of
ADODB.connections, and look here http://www.aspfaq.com . The (sound)
philosophy is to create your object *when* and *where* you need it, and then
destroy it asap having used it. This is by far the most robust way, even if
it means putting the same lines of code in many scripts.

HTH

Peter

"Peter Koller" <pe**********@systeam.no> wrote in message
news:Ok**************@TK2MSFTNGP10.phx.gbl...
Won't the local "pointer" cnRet be destroyed when it goes out of scope?
Anyways, the reason for cCon() is lazyness, one line instead of three..

I tried to "manually" open the connections in my functions without using
cCon(), but i still error, atlhough this time when reading a session
variable (i only have one session variable holding an int so its not that
either).
In perfmon i have at least 200mb of free memory at all times. The maximum
amount of connections to my sql server is 6.


"Peter James" <ow****@yahoo.co.uk> skrev i melding
news:bf**********@codas.jet.uk...
Peter
Looks to me like every time you call cCon() you create an object *cnRet*

but
it is never destroyed. In function foo() you create another object *con*
which is destroyed on completion, but I doubt that that destruction will
cascade back to *cnRet*.

If it is not a rude question - why use a helper function to create an
ADODB.connection object? It is a straightforward action unlike a Win32

API
call for example.

HTH

Peter
"Peter Koller" <pe**********@systeam.no> wrote in message
news:ey**************@TK2MSFTNGP10.phx.gbl...
Hi group!

I am getting the following error from my ASP application:
Microsoft VBScript runtime error '800a0007'

Out of memory: 'Server.CreateObject'

It always (as far as i have observed) occurs when i try to create a new ADODB.connection object in my cCon helper function (opening a connection
and
returning it):

Function cCon()
Dim cnRet
set cnRet = server.createobject("ADODB.Connection") 'This is where

the error is thrown
cnRet.connectionstring = GLB_CONSTR_DB
cnRet.open
Set cCon = cnRet
End Function
The page that errors will typically call this function 6- 10times from
different functions which handle their connections in this way:

Function Foo()
dim Con ...
Set con = cCon()
.... function code
con.close
set con = nothing
End Function

All my recordsets are disconnected and also destroyed with .close and

Set rst = nothing.

I have tested the application on two seperate servers with the same

result.

Both machines had more than enough memory.

I have also checked the application log to see if anything was logged, but there wasnt.

Any one got ANY ideas on this one? I'm starting to get desperate!




Jul 19 '05 #4
Follow-up

Just checked the function I mentioned in my other post. It is different from
yours in that we do not use an intermediate variable. Your function would
look like:

Function cCon()
set cCon = server.createobject("ADODB.Connection")
cCon.open GLB_CONSTR_DB
End Function

I don't think that this should make any difference but you might try it.

--
Mark Schupp
--
Head of Development
Integrity eLearning
Online Learning Solutions Provider
ms*****@ielearning.com
http://www.ielearning.com
714.637.9480 x17
"Peter Koller" <pe**********@systeam.no> wrote in message
news:Ok**************@TK2MSFTNGP10.phx.gbl...
Won't the local "pointer" cnRet be destroyed when it goes out of scope?
Anyways, the reason for cCon() is lazyness, one line instead of three..

I tried to "manually" open the connections in my functions without using
cCon(), but i still error, atlhough this time when reading a session
variable (i only have one session variable holding an int so its not that
either).
In perfmon i have at least 200mb of free memory at all times. The maximum
amount of connections to my sql server is 6.


"Peter James" <ow****@yahoo.co.uk> skrev i melding
news:bf**********@codas.jet.uk...
Peter
Looks to me like every time you call cCon() you create an object *cnRet*

but
it is never destroyed. In function foo() you create another object *con*
which is destroyed on completion, but I doubt that that destruction will
cascade back to *cnRet*.

If it is not a rude question - why use a helper function to create an
ADODB.connection object? It is a straightforward action unlike a Win32

API
call for example.

HTH

Peter
"Peter Koller" <pe**********@systeam.no> wrote in message
news:ey**************@TK2MSFTNGP10.phx.gbl...
Hi group!

I am getting the following error from my ASP application:
Microsoft VBScript runtime error '800a0007'

Out of memory: 'Server.CreateObject'

It always (as far as i have observed) occurs when i try to create a new ADODB.connection object in my cCon helper function (opening a connection
and
returning it):

Function cCon()
Dim cnRet
set cnRet = server.createobject("ADODB.Connection") 'This is where

the error is thrown
cnRet.connectionstring = GLB_CONSTR_DB
cnRet.open
Set cCon = cnRet
End Function
The page that errors will typically call this function 6- 10times from
different functions which handle their connections in this way:

Function Foo()
dim Con ...
Set con = cCon()
.... function code
con.close
set con = nothing
End Function

All my recordsets are disconnected and also destroyed with .close and

Set rst = nothing.

I have tested the application on two seperate servers with the same

result.

Both machines had more than enough memory.

I have also checked the application log to see if anything was logged, but there wasnt.

Any one got ANY ideas on this one? I'm starting to get desperate!




Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Davinder | last post by:
I am trying to invoke the following line of code within my ASP: Set oApp = Server.CreateObject("Word.Application") This results in the following error: ASP 0178 Server.CreateObject Access...
1
by: Raúl Martín | last post by:
I´ve a function in asp that run correctly but If I tried to change it forasp.net in asp: xmlHTTP = CreateObject("Microsoft.XMLHTTP") And I thought to use this sentence for asp.net but the...
12
by: karen | last post by:
Hi all : this is going to be a long post. So i apologize in advance :) i am converting a java program in VB right now. I am a java programmer by trade. so i am no expert in this department. I...
4
by: Andrew Hilton | last post by:
When you create an object in classic asp code, should you always use Server.CreateObject("ProgID")? Are there implications with stability (ie memory leaks) if you create COM objects in other ways...
4
by: Bill Nguyen | last post by:
Win 2003 IIS 6.0 My users got this error message trying to run a simple ASP application (sending email using CDO). I have no problem ( with Admin permission): Server object error 'ASP...
0
by: quintesv | last post by:
hi all, Running VS.2003 , framework 1.1. I have a COM object written in Delphi which im trying to call through ASP.NET. The COM object connects to a folder on another machine and opens a...
1
by: ashish | last post by:
Dim oCon Err.Clear Set oCon = Server.CreateObject("ADODB.Connection") If Err.Number = 0 Then '// '// Open an ADODB.Connection to the folder URL '// oCon.Provider = "ExOLEDB.DataSource"
3
by: Sagar | last post by:
I am working on a project where Server.CreateObject is replaced with CreateObject all over the project. Though I know that this will improve performance in terms of Memory overlhead because of how...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.