Solved

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

Posted on 2003-10-22
1
743 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

706 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now