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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses
Course of the Month14 days, 9 hours left to enroll

771 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