Solved

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

Posted on 2003-10-22
1
754 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
[X]
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
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

705 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