Solved

ProgramWorkspace = DBEngine.CreateWorkspace("ProgramWorkspace", "ProgramUser", "federation") works for access 97, does not work for Access 2003

Posted on 2008-06-12
4
855 Views
Last Modified: 2011-09-20
I used following VB6 code to run MS Access 97
ProgramWorkspace = DBEngine.CreateWorkspace("ProgramWorkspace", "ProgramUser", "federation")

After the MS Access is upgraded to 2003, this line of the code is not working any more. The Visual Basic Error message is:

Cant open database . It may not be a database that your application recognized, or the file may be corrupt.

What should it be for Access 2003?
DBEngine.SystemDB = App.Path + "\" + "system.mdw"
Set ProgramWorkspace = DBEngine.CreateWorkspace("ProgramWorkspace", "ProgramUser", "federation")

Open in new window

0
Comment
Question by:jiaochao
  • 2
  • 2
4 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 21776533
Have you updated all your reference libraries in your VB6 app to reflect the new version of the Access being used?
0
 

Author Comment

by:jiaochao
ID: 21776848
Hi Peter57r,
Thanks. It works for the system.mdw. When the code asks to access the Access database itself, I got following error:

Unrecognized database format "\\MCL-Srv1\vol1\networks\share\cmtce\tmsinfo\copy of nokia card data controller\ncdccode\current\log.mdb

Regards
0
 
LVL 77

Expert Comment

by:peter57r
ID: 21777379
Yes, I understand that...

so...
"Have you updated all your reference libraries in your VB6 app to reflect the new version of the Access being used?"
0
 

Accepted Solution

by:
jiaochao earned 0 total points
ID: 21828706
Many thanks peter57r. I understand what you are saying. I tried all possiable references with different seq. At the end I decide to change my method. Instead of using the ADO or DAO to create tables and fields, I am now pre-set a MS Access template with all the structures. I will replication my sql database into this template to make the replicate database. It works find. Thanks again for your attension. Cheers
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.Net Tranfer data between to VB.Net apps 8 25
VB.net and sql server 4 35
Error with a code discussed on this page 5 14
aggregate query? 20 47
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
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…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

770 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