|
-
Feb 20th, 2009, 01:27 PM
#1
Thread Starter
New Member
[RESOLVED] VB6 to MS Access 07 - ADO / datagrid.
Hello everyone,
I am using an ADOdc object to connect to an MS Access 07 database from my VB6 program.
In my first form, I add some data to a table in the database. In my second form, I then use an SQL query to search for the previously entered primary key (from the previous form), and only display records with that primary key in the datagrid.
Unfortunately, the datagrid will not display the last created record (i.e. the most recent record, which was added in the previous form).
The SQL query searched by a defined parameter "OrderID", which is taken from a text box on the form. If i set the text box to a number before compiling, instead of calling it from the previous form, the datagrid will display the correct record. Also, if i set the SQL query to display all records, it still will not show the most recent record.
As I say in the code, the SQL query works just fine if i set the text box to a number of an existing record before i run the code, so I believe the problem is just to do with the most recent record for some reason.
Sorry it's a long post, and any help would be massively appreciated. If it makes it easer for you to see the project itself, please ask.
Thanks again, best wishes,
Last edited by rainer; Apr 27th, 2009 at 08:17 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|