Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


recordset troubles

Posted on 2003-03-11
Medium Priority
Last Modified: 2013-11-26
I am attempting to bind an MSHFlexgrid with records from a database, but I am encountering the following problem:
The database recordset contains over 25000 rows.
Setting the Recordset property of the flexgrid to a db.Execute query yields only the column headers, no records.
Setting the Recordset property to an already filled recordset limits the rows to 2049 (2048 + column header line)
My code is below. Does anyone have any idea why I am getting this problem and how to correct it?

Public db As ADODB.Connection
Public dbr as ADODB.Recordset
Public Sub Connect()
Dim strConn As String
Dim strQuery as string
Dim dbCustomers
strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyDatabase.mdb"
Set db = New ADODB.Connection
db.Open strConn
strQuery = "SELECT Record_ID,Sorting_ID FROM Customers ORDER BY Record_ID"
'Method 1: Bind Recordset Property to Recordset (dbr fills with all the Rows, MSHFlexgrid1 contains only 2049 rows)
Set dbr = New ADODB.Recordset
dbr.Open strQuery, db, adOpenKeyset, adLockOptimistic
Set MSHFlexgrid1.Recordset = dbr
'Method 2: Bind Recordset Property to db.Execute Query (MSHFlexgrid1 contains only the column headers - no rows)
Set MSHFlexgrid1.Recordset = db.Execute(strQuery)
End Sub
Question by:wolfrose

Author Comment

ID: 8122715
problem solved.  I used a forward only recordset and it all worked fine.  It was a wierd one, but THAT'S PROGRAMMING!!

Accepted Solution

SpideyMod earned 0 total points
ID: 8227286
PAQ'd and points refunded.

Community Support Moderator @Experts Exchange

Featured Post


Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month15 days, 23 hours left to enroll

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question