Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2009
    Posts
    23

    Unanswered: Loading records in database

    I just want to ask if there is any way to speed up loading of records
    I have exactly 1 million record.

    my example of loading database
    Code:
     
    Call Load_Database
    set rs = new recordset
    rs.open "Select field1,field2 From Table1 where field2 = 'Unused'", db, adOpenDynamic, adLockOptimistic
    then the first record will be loaded to Textbox.

    Code:
     
    text1.text = rs.Fields(0)
    set rs = nothing
    My problem is it takes a time to load. I dont need MSFlexgrid or datagrid, i just have to load and get the first record.

    thanks in advance
    Last edited by kristle.sison26; 04-06-09 at 02:12.

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    try to cut down the amount of data you are retrieving
    consider using the "top" clause.

    make sure the column field2 is indexed
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Jun 2004
    Location
    Arizona, USA
    Posts
    1,848
    ADO also supports retrieving records one 'page' at a time...
    Lou
    使大吃一惊
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert


  4. #4
    Join Date
    Feb 2009
    Posts
    23
    thanks for the reply.

    i use top clause, wasnt able to create an INDEX because i read some sites telling that it affects the speed when i update the table because the INDEX must be updated too.

Posting Permissions

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