Solved

Creating old file version of access by CDaoDatabase

Posted on 2003-11-17
11
237 Views
Last Modified: 2013-11-20
Hi,
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;
pTempAccessDb->Create(m_DBFilePath);
CREATE TABLE ...

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 !!!!
0
Comment
Question by:kukiya
[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
  • 5
  • 3
11 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 9763050
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)?
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 9763065
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?
0
 

Author Comment

by:kukiya
ID: 9763066
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...
0
Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

 

Author Comment

by:kukiya
ID: 9763081
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...
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 9763134
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.
0
 

Author Comment

by:kukiya
ID: 9763229
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???

Thanks
0
 
LVL 44

Accepted Solution

by:
AndyAinscow earned 100 total points
ID: 9763253
'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
FO_COPY
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.
0
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 11849702
My comments would be a way to achieve the desired effect
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

630 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