Joel wrote:
Gentlemen,
I still don't understand why... But the only way MySql works is if you
set rstTable.CursorLocation = adUseClient. (if it's not set it won't
.Update, load a grid, doesn't know .RecordCount etc.) Is there any way you
can set the a global default to adUseClient?
I couldn't find any example of setting adUseClient in a global way, only
on a per-RecordSet basis.
FWIW, the issue you're facing is pretty common to client/server RDBMS's,
not just MySQL. The client can't get the RecordCount until it has
downloaded the full result set. That's effectively what adUseClient
does, from what I infer (I'm not an ADO user).
One reason for this limitation is that client/server applications often
deal with large result sets, which might exceed memory, so they are
prepared in batches instead of holding the full result set in memory.
So be careful about using adUseClient, if your result sets can grow to
be huge; you might choke your network as it downloads, or you might hit
your client's memory capacity, or downloading the result set in one
batch will cause a delay in your client application.
One commonly used workaround is to run a SELECT COUNT(*) query to fetch
the number of records.
Regards,
Bill K.