Results 1 to 12 of 12
  1. #1
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Slow conn (2000 sr-1)

    i use this piece of code to select records in table...
    I test with PF8 the scrupt... but after10 mins not still the cursor after the line of the select!!!!!!!!!!!!!!
    dim of mdb 447.458 mega
    number of records 988.7665
    in the first field named COPE have the index and primary Key
    suggestion to make fast this operation?
    Tks


    Private Sub Form_Load()
    mnuDelete.Enabled = False
    Set cn = New ADODB.Connection
    Set rs = New ADODB.Recordset
    cn.Open "provider=microsoft.jet.oledb.4.0; data source=GCD01F4500DATIPUBBLICAANTIRICANAGRAFICA.MDB "
    With rs
    .ActiveConnection = cn
    .CursorLocation = adUseClient
    .CursorType = adOpenDynamic
    .LockType = adLockOptimistic
    ''''''''''''here the cursor is slow
    .Source = "select * from ANAGRAFICA1"
    ''''''''''''here the cursor is slow
    .Open
    End With
    lblMsg.Caption = "Please enter the number you want to search."
    End Sub

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Slow conn (2000 sr-1)

    988.7665 is a lot of records. Why do you need to open a recordset in another database?

  3. #3
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Slow conn (2000 sr-1)

    "Why do you need to open a recordset in another database?"
    but anagrafica1 is the table of mdb anagrafica(?!)

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Slow conn (2000 sr-1)

    Which database contains the form and the VBA code?

  5. #5
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Slow conn (2000 sr-1)

    I am sorry Hans is post in VB classic, very sorry.
    Attached original script refered this post.
    Still i am stupid to insert question in wrong room:-(

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Slow conn (2000 sr-1)

    I will leave the thread in the Access forum, since the question is related to Access, but it wasn't clear from the question and from the version info that you were running the code from VB6.

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Slow conn (2000 sr-1)

    The question now becomes: do you really need to load all records into the recordset?

  8. #8
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Slow conn (2000 sr-1)

    Sorry for all... solved my self. (i am stupid!!!)
    But only one...
    How to change the name of various item in menu named "File" of all form?

  9. #9
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Slow conn (2000 sr-1)

    Isn't there a menu editor in VB6?

  10. #10
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Slow conn (2000 sr-1)

    Hans welcome in my home....
    Yes i work now with VB6...
    I want hnge the item in File menu...
    Instead "Delete ....." i want change in italian, naturally!;-)

  11. #11
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Slow conn (2000 sr-1)

    Click the Menu Editor button on the toolbar or press Ctrl+E to change the menu items.

  12. #12
    Gold Lounger
    Join Date
    Jan 2004
    Location
    Italy
    Posts
    3,245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Slow conn (2000 sr-1)

    Sorry for stupid qstion, Hans...
    But this is the first or second my litle project in VB...
    Tks for patience with the "Stupid Sal"....
    You are very comprensive with newbie, sure.!
    Tks naturally for your time.

Posting Permissions

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