Solved

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

Posted on 2008-06-12
4
877 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
[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
  • 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
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.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

737 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