[Resolved] VB6 & Unrecognized Database Format Access 2003
Hi All,
I have a VB6 project that I inherited about 3 years ago that I am just trying to maintain. They are legacy programs that does payroll and reporting. The original projects connected to a Access 97 database using DAO. I was able to convert the Access 97 database to Access 2003 with no errors. I updated the visual basic projects changing the reference from DAO 3.51 object library to the DAO 3.6 object library. Once I try to compile and execute the program I receive the Unrecognized Database format error. The database works fine in Access 2003. Is there another reference I should add?
I just need direction on where to start to look. Because it was programmed with DAO parameters, there is not connection string in the code. There is a directory variable that points to the database.
Any help is appreciated.
Debbie H
Re: VB6 & Unrecognized Database Format Access 2003
I stopped using DAO a long time ago but am thinking that DAO 3.6 pre dates Access 2003 by a few years. I am not sure if it is compatible. I am wondering why you would convert the DB to 2003 format?
Re: VB6 & Unrecognized Database Format Access 2003
Hi Debbie,
try it with a Access 2000 Database
Re: VB6 & Unrecognized Database Format Access 2003
I currently (only) use Access 97 DBs
Had a large project that was DAO.
I kept the Access 97 DBs, and progressively (over a few months) converted my numerous Forms to ADO
They happily ran beside each other (DAO and ADO) until they were all converted.
And are still using Access 97 DBs
Re: VB6 & Unrecognized Database Format Access 2003
Access 2000 format should work with DAO 3.6. I can't be sure but I think 3.6 was released at the time of Access 2000 and was required to use the 2000 format. Pretty sure it works with Access 2002 but maybe not with the 2003 version.
Re: VB6 & Unrecognized Database Format Access 2003
Acc2003 and DAO3.6 do work together!
I'd rather try the following:
Dump all Data from your "original" Acc97-database
Create a new Database in Acc2003 from a blank slate.
recreate your table/Column-Structure
Import the dump back into the new DB.
test and debug from VB6
Re: VB6 & Unrecognized Database Format Access 2003
Access 2000 and Access 2003 both parasitize VB's Jet JET_ENGINETYPE_JET4X format. The private structures they'll embed are different, but the host database they lay their filthy eggs in is the same.
Re: VB6 & Unrecognized Database Format Access 2003
Thanks for all of your suggestions. I did try to convert the database to Access 2000 and I still received the unrecognized error. The reason I converted to 2002-2003 database format, was so that I did not have rewrite the vba project. I can read VBA and make minor changes, but cannot make any major changes probably without breaking the code along the way. Yes, currently my users are on Access 97, but they are upgrading to Windows 10 in the next couple of weeks and so this was a good time to update the database. As I mentioned, I inherited this project from a gentleman who passed away really suddenly and I have been trying to maintain.
I actually have another VB Project that attaches to the same Access database and everything work fine. I was able to compile the project, create a setup.exe, and install it on Windows 10. I just cannot figure out what is different between the two projects that would render the error. I use the same references and everything.
I know I am looking for a needle in the haystack -- thanks for all of your comments. If there are other that would like to chime in, I am all for it.
Re: VB6 & Unrecognized Database Format Access 2003
Thanks for all of your suggestions. I did try to convert the database to Access 2000 and I still received the unrecognized error. The reason I converted to 2002-2003 database format, was so that I did not have rewrite the vba project. I can read VBA and make minor changes, but cannot make any major changes probably without breaking the code along the way. Yes, currently my users are on Access 97, but they are upgrading to Windows 10 in the next couple of weeks and so this was a good time to update the database. As I mentioned, I inherited this project from a gentleman who passed away really suddenly and I have been trying to maintain.
I actually have another VB Project that attaches to the same Access database and everything work fine. I was able to compile the project, create a setup.exe, and install it on Windows 10. I just cannot figure out what is different between the two projects that would render the error. I use the same references and everything.
I know I am looking for a needle in the haystack -- thanks for all of your comments. If there are other that would like to chime in, I am all for it.
Re: VB6 & Unrecognized Database Format Access 2003
Quote:
I just need direction on where to start to look. Because it was programmed with DAO parameters, there is not connection string in the code. There is a directory variable that points to the database.
look at the project that does work, to find the appropriate connection string, for ADO, i am sure you need to have that or parameters for the connection object
Re: VB6 & Unrecognized Database Format Access 2003
Thanks Pete for your suggestion. The VB Project was written in DAO not ADO and there is no connection string. The Project uses variables to connect the database.
Re: VB6 & Unrecognized Database Format Access 2003
Quote:
Originally Posted by
DebbieH
Thanks for all of your suggestions. I did try to convert the database to Access 2000 and I still received the unrecognized error. The reason I converted to 2002-2003 database format, was so that I did not have rewrite the vba project. I can read VBA and make minor changes, but cannot make any major changes probably without breaking the code along the way. Yes, currently my users are on Access 97, but they are upgrading to Windows 10 in the next couple of weeks and so this was a good time to update the database. As I mentioned, I inherited this project from a gentleman who passed away really suddenly and I have been trying to maintain.
I actually have another VB Project that attaches to the same Access database and everything work fine. I was able to compile the project, create a setup.exe, and install it on Windows 10. I just cannot figure out what is different between the two projects that would render the error. I use the same references and everything.
I know I am looking for a needle in the haystack -- thanks for all of your comments. If there are other that would like to chime in, I am all for it.
try this
create a new VB6 Project and add a Ref. to Microsoft Jet and Replication Objects 2.6 Library
use a Copy of your Access97 Database and then..
Code:
'set Ref. to : Microsoft Jet and Replication Objects 2.6 Library
Option Explicit
Private Sub Command1_Click()
Dim oJro As JRO.JetEngine
Dim cnn1 As String, cnn2 As String
Set oJro = New JRO.JetEngine
'convert Access 97
cnn1 = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data source=E:\myTest.mdb;" & _
"Jet OLEDB:Engine Type = 4;" & _
"Jet OLEDB:Database Password ="
'to Access 2000
cnn2 = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data source=E:\base2000.mdb;" & _
"Jet OLEDB:Engine Type = 5;" & _
"Jet OLEDB:Database Password ="
'Compact
oJro.CompactDatabase cnn1, cnn2
End Sub
hth
Re: VB6 & Unrecognized Database Format Access 2003
I want to thank everyone for all their help. The problem has been solved. On the object (Form) there were references to Data1, Data2, Data3, Data4 up to Data11. These active x data objects pointed to an Access database. Once I changed this one parameter to Access 2000, the project compiled and was able to find the database and display all of the data.