Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Insufficient memory

crowmastercrowmaster Member Posts: 1
Hi Everyone.

I have a bit of a weird error and wonder if anyone can help?

I have written a VB6 app which basically sits and performs a timer-based loop which looks for files in a directory.

On finding a file the program then opens an adodc connection similar to the way shown below:

[code]
Dim dbconn As ADODB.Connection, cnString As String, sqlquery As String
Set dbconn = New ADODB.Connection
cnString = "Provider=SQLOLEDB.1;Persist Security Info=False;Initial Catalog=ENGDEV;Data Source=SQLSERVER"
dbconn.ConnectionString = cnString
dbconn.Open


[/code]

The program uses this connection string to execute an update query based upon the contents of the tet file that was found and then closes the connection as follows
[code]
'execute the query that has been generated
dbconn.Execute (sqlquery)
'close conn
dbconn.Close
Set dbconn = Nothing
[/code]

The program will then continue looping until such time as another file is encountered.

This works absolutely perfectly until the application has been running for about 24 hours at which point when the application tries to open the database connection a message displaying the following is displayed

[b]
Run-time error '-2147467259 (80004005)':

[DBNMPNTW]Insufficient memory
[/b]

Is this being caused because my program is not freeing up memory during the loop or is there another reason???

Please Help

Comments

  • GideonOmegaGideonOmega Member Posts: 617
    : Hi Everyone.
    :
    : I have a bit of a weird error and wonder if anyone can help?
    :
    : I have written a VB6 app which basically sits and performs a timer-based loop which looks for files in a directory.
    :
    : On finding a file the program then opens an adodc connection similar to the way shown below:
    :
    : [code]
    : Dim dbconn As ADODB.Connection, cnString As String, sqlquery As String
    : Set dbconn = New ADODB.Connection
    : cnString = "Provider=SQLOLEDB.1;Persist Security Info=False;Initial Catalog=ENGDEV;Data Source=SQLSERVER"
    : dbconn.ConnectionString = cnString
    : dbconn.Open
    :
    :
    : [/code]
    :
    : The program uses this connection string to execute an update query based upon the contents of the tet file that was found and then closes the connection as follows
    : [code]
    : 'execute the query that has been generated
    : dbconn.Execute (sqlquery)
    : 'close conn
    : dbconn.Close
    : Set dbconn = Nothing
    : [/code]
    :
    : The program will then continue looping until such time as another file is encountered.
    :
    : This works absolutely perfectly until the application has been running for about 24 hours at which point when the application tries to open the database connection a message displaying the following is displayed
    :
    : [b]
    : Run-time error '-2147467259 (80004005)':
    :
    : [DBNMPNTW]Insufficient memory
    : [/b]
    :
    : Is this being caused because my program is not freeing up memory during the loop or is there another reason???
    :
    : Please Help
    :


    it looks like you have a memory leak - I would start by making sure you are not creating more objects each time in your loop then you are destroying, I have heard of ppl having problems with ADO and long running programs, It could be a bug in the ADO model.
    [blue]
    C:Dos
    C:Dos Run
    Run Dos Run
    [/blue]

Sign In or Register to comment.