Creating old file version of access by CDaoDatabase

I have a problem I can't solve.
I'm using the visual C++ to create an Access file by the following code:

CDaoDatabase  pTempAccessDb;      
AfxGetModuleState()->m_dwVersion = 0x0601;

but when I try to open the file in my Access XP version, a dialog is opened to choose whether to convert the file or open it.

I guess the file was built in an old version of Access.
How can I solve this problem???
Thanks in Advance !!!!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AndyAinscowFreelance programmer / ConsultantCommented:
I think you will find your DB is in Access 2000 format.

The message
a dialog is opened to choose whether to convert the file or open it
Should only appear the first time you try to open the DB from Access itself.  

What problems are being caused if you select the 'open' option (or the convert option)?
AndyAinscowFreelance programmer / ConsultantCommented:
Or even worse in Access 97 format (dbVersion30 as parameter default in you create call), the 0x0601 will allow the DAO to open Jet4 format.

Can't you create the (empty) database with AccessXP then use DAO or ADO code to populate it with tables and queries as you require?
kukiyaAuthor Commented:
The problem is that I re-create the file many times, so every time I open the access file,this dialog appears. It doesn't look good...
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

kukiyaAuthor Commented:
I must create the file by the code, and not with Access.

As for ADO , I'm not familiar with the method.
maybe using  ADO and not Dao will help...
AndyAinscowFreelance programmer / ConsultantCommented:
Could you create an 'empty' DB with AccessXP and your app makes a copy of this to the functional DB when required?

I've never tried creating a DB itself from code.  I always have a preprepared one I copy as above.
kukiyaAuthor Commented:
I need to create the file via a dialoge in wich the user chooses the path and the file name...

Is ADO ca  help ??? How do I change the code to work with ADO???

AndyAinscowFreelance programmer / ConsultantCommented:
'I need to create the file via a dialoge in wich the user chooses the path and the file name...'

No problems if you are doing the copy of an existing DB.
Look at SHFileOperation and SHFILEOPSTRUCT in the help
Copy the files specified in the pFrom member to the location specified in the pTo member

Major changes going from DAO to ADO.  However bear in mind DAO is not going to be developed further by Microsoft.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AndyAinscowFreelance programmer / ConsultantCommented:
My comments would be a way to achieve the desired effect
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
System Programming

From novice to tech pro — start learning today.