dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: how to reduce recordset opening time(ADO

  1. #1
    Join Date
    Aug 2004
    Posts
    43,023

    how to reduce recordset opening time(ADO

    [Originally posted by Liju John]

    hi friends,
    iam working in a vb application connected
    with a big database in msaccess. One of
    the table in the database has nearly
    5000 records. when opening the table using
    a recordset object in ADO it takes nearly 10-15
    seconds. how can reduce this time taken
    to open the recordset object.
    if there is no option in ADO, is there any
    way i can reduce the time using multithreading.
    That is to open the recordset in the background
    while we work in a form in vb.
    please reply
    bye
    liju


  2. #2
    Join Date
    Aug 2004
    Posts
    43,023

    Re:how to reduce recordset opening time(ADO

    [Originally posted by Zip]

    Hi ,
    1) Create a query that only sele3cts the records that are pertenant @ that moment in time. (Preferred method as this ensures you rae only getting what is need..Thinking is good for you)

    2) Create an Activex Exe that loads the data
    In this case use a timer event to actually do the work
    eg.

    'Exposed COM Method
    Public Sub loadRecords()
    Timer.enabled = true
    End Sub

    Private Sub Timer1_Timer() 'Assscoated with the timer control
    Timer1.Enabled =False
    'Get your records
    End Sub

    Hope this gets you going
    Zip

  3. #3
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:how to reduce recordset opening time(ADO

    [Originally posted by Liju John]

    ok. it is working. i give the sql statement
    that opens the recordset in a timer control.
    it is opening in the background and I got the
    focus in the form. But I can't work in the form
    while it is going on. That is I can't type
    any thing using the keyboard.
    Is it possible to use the keyboard while some
    disk operation(opening the recordset) is going
    on˙ in the background?.
    Please reply
    Liju

  4. #4
    Join Date
    Aug 2004
    Posts
    43,023

    Re:Re:how to reduce recordset opening time(ADO

    [Originally posted by Liju John]

    ok. it is working. i give the sql statement
    that opens the recordset in a timer control.
    it is opening in the background and I got the
    focus in the form. But I can't work in the form
    while it is going on. That is I can't type
    any thing using the keyboard.
    Is it possible to use the keyboard while some
    disk operation(opening the recordset) is going
    on˙ in the background?.
    Please reply
    Liju

  5. #5
    Join Date
    Aug 2004
    Posts
    43,023

    Re:how to reduce recordset opening time(ADO

    [Originally posted by Season]

    Hi,
    When use Open method of recordset,
    you can add 'adAsyncExecute' flag in parameter 'Options'.

    Then use the following code to check state of the recordset.

    Do While (recordset.State And adStateExecuting) = adStateExecuting

    ˙ ˙ ˙ ' Do something here
    ˙ ˙ ˙ DoEvents
    Loop

    Season

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center