Solved

VC++, .MDB Files, ADO and ADOX programming

Posted on 2003-10-22
1
748 Views
Last Modified: 2013-11-27
I have a VC++ program in which I am using ADO and ADOX to open and create as need an Access .MDB file.  For the most part things are working fine.  However, I do have a problem that I will try to describe in general terms and see if I can get a solution.  If needed I can provided code snippets, etc.

The program works as follows as it starts and attempts to open the database:  

1.  If the database exists, everything opens and the program works fine from start to finish
2.  If the database does not exist, a create routine is called that creates the database, 3 tables, and a variety of indexes per table.
2a.  If I immediately stop the program at this point and restart it, the program works fine from start to finish.
2b.  If I continue to use the program and attempt something that accesses one of my Indexes, I get an ADO Exception that the Index does not exist in the database/table.  If I stop the program and use Access to open the database and the design tool, everything looks fine -- the tables and indexes are all there.  I can restart the program, attempt the same procedure as before to access the Index and all works well.

Any ideas why this would be happenning -- when the Index would not be seen after getting Appended to the table?  I'm using MDAC 2.6 and I've checked to make sure that I am appending and releasing everything in the create routine before calling the open routine to finish the process.
0
Comment
Question by:markparr
1 Comment
 
LVL 32

Accepted Solution

by:
jadedata earned 100 total points
ID: 9600470
Hey! markparr,

  It sounds like VC++ is over-running Access's ability to get the system tables adjusted before launching into usage of those objects.

  Try "reigning in" the program for a few milliseconds to allow the ADO engine to finalize the system table updates before proceeding to use the new objects.  

regards
Jack
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

809 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