Re: Opening a MySQL table using ADODB.Recordset

Tech-Archive recommends: Speed Up your PC by fixing your registry

From: Val Mazur (group51a_at_hotmail.com)
Date: 03/18/04


Date: Wed, 17 Mar 2004 21:10:26 -0500

Hi,

You could expect this result. What is the point to open recordset, which
contains 500,000 recordset in it? Usually you do not need all the records at
same time and I would suggest to select only the records, which you really
need. Your PK here is not a problem , since you do not have any joins in
your query. This is just a bad programming practice. If you really need all
the records, then you could be more specific what you are trying to achieve
using so big recordset. In this case someone could suggest better solution

-- 
Val Mazur
Microsoft MVP
"langron" <anonymous@discussions.microsoft.com> wrote in message 
news:0ACC06B2-7A94-457D-BAD3-04CE5308E796@microsoft.com...
>I have no problem opening a MySQL table containing 400 records using the 
>following syntax:
>
>    Dim Cnt As New ADODB.Connection
>    Dim Rec As New ADODB.Recordset
>    Cnt.Open _
>        "DRIVER={MySQL ODBC 3.51 Driver};" & _
>        "SERVER=localhost;" & _
>        "DATABASE=MyDatabase;"
>    SQL = "SELECT * FROM `My Table`"
>    Rec.CursorLocation = adUseClient
>    Rec.Open SQL, Cnt, adOpenKeyset, adLockOptimistic
>
> But if I try to open a table with over 500,000 records, my computer hangs 
> (I've waited for over 1/2 hour). I have 1 GB memory and a 2.8 GH 
> processor. Can someone tell me what might be causing my computer to hang 
> at the Rec.Open statement?
>