Solved

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

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

863 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

23 Experts available now in Live!

Get 1:1 Help Now