+ Reply to Thread
Results 1 to 5 of 5

Why This Code Increase Memory Usage

Hybrid View

  1. #1
    Registered User
    Join Date
    08-24-2006
    Location
    Jakarta, Indonesia
    Posts
    3

    Why This Code Increase Memory Usage

    Hi guys, i'm a newbie in this forum, and this is my first question here, hope anyone here willing to help.
    thanks.
    Attached Files Attached Files

  2. #2
    Registered User
    Join Date
    08-24-2006
    Location
    Jakarta, Indonesia
    Posts
    3
    hello there ...
    i don't believe if everyone here can't help me
    Regards,
    Ferry Huang

  3. #3
    Forum Expert
    Join Date
    01-03-2006
    Location
    Waikato, New Zealand
    MS-Off Ver
    2010 @ work & 2007 @ home
    Posts
    2,243
    Hi,

    Try posting the problem code as text within a post & you'll be more likely to get an answer because not many people feel like trusting/risking enough to download & open unknown attachments.

    hth
    Rob Brockett
    NZ
    Always learning & the best way to learn is to experience...

  4. #4
    Registered User
    Join Date
    08-29-2006
    Posts
    5

    Accessing a database

    Hey you might want to read the article located here. http://www.microsoft.com/technet/scr.../tips1103.mspx

    It should give you the information you need.

  5. #5
    Registered User
    Join Date
    08-24-2006
    Location
    Jakarta, Indonesia
    Posts
    3
    Here it is, the code with the problem

    Option Explicit

    Public con As New ADODB.Connection
    Public rs As New ADODB.Recordset

    Public Sub RetrieveData()
    If (con.State = adStateOpen) Then Call con.Close
    Call con.Open("Provider=MSDASQL.1;Extended Properties=""DSN=Excel Files;DBQ=" & ThisWorkbook.FullName & ";DefaultDir=" & ThisWorkbook.Path & ";DriverId=790;MaxBufferSize=2048;PageTimeout=5;""")
    If (rs.State = adStateClosed) Then
    Call rs.Open("SELECT T.* FROM T", con, adOpenStatic, adLockReadOnly, adCmdText)
    Else
    Call rs.Requery
    End If
    ' Call rs.MoveNext 'why this operation increase memory usage???
    ' Call MsgBox(rs.RecordCount) 'and this one too. how to anticipate this?
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1