Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Creating old file version of access by CDaoDatabase

Posted on 2003-11-17
11
Medium Priority
?
240 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
Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

 

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 400 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

721 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