Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access 2002 Connection 1

Status
Not open for further replies.

briancoats

Programmer
May 1, 2003
61
US
I have until Noon (CST) today to get this connection up. I have been taking the easy way out by using the data control for my database connections. This will not work with 2002 and I am now in a real bind with a customer breathing down my neck to get this thing up and running. Can someone explain the difference in DAO and ADO or at least tell me which I need to use and maybe give me an example of how to connect to a database and do querries to it. I am going to be needing to do add news and things too.

Thanks for your help. I am lost and have no time to find it right now.

Brian

---Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
 

If you have been using DAO, or a DAO datacontrol to connect to a '97 JET 3 MDB until now and are having problems connecting to a higher MDB version (JET 4), then update your VB to SP 5. The DAO DataControl from there is capable of openning JET MDBs - you just need to select the right type in the properties window under the property "Connect".
When VB6 first came out, a JET 3 (1997) was the newest version. Now we have JET 4, and but the original DataControl can only read JET 3 Mdbs.
 
Well, I have SP5 and I dropped down the connect on my datacontrol, and access 2000 was the highest that was on the list. Do I need to change my referenced controls maybe?

Thanks.

Brian
 
I am now. I changed it from DAO 3.51 Object Library to 3.6 Object Library. Do I need to change my components because this had no effect on the list in my datacontrol even after I put a new DataControl on the form.

Brian
 

A Connect "Access 2000" is for 2000 and 2002 - they both are JET 4 Mdbs.

It should work.

What errors do you receive?



You can also add the DAO 3.6 reference and then do this:

dim db As DAO.Database
dim rs As DAO.Recordset

Private Sub Form_Load()

Set db = DBEngine(0).OpenDatabase("C:\my2002.Mdb")
Set rs = db .OpenRecordset("SELECT * FROM SomeTable")
Set Data1.Recordset = rs

End Sub
 
Well, when I used the actual DataControl, I was building a file from a random access file that i had made to convert the program over to database. Anyway, I got that data out of the file and into the database but it converted my database to access 2000 format, which is not what my customer wants.

I am learing a lot from this discussion and I thank you for taking the time to help me. CClint in the BombDiggity
 
no problem...but, I'm not clear if we are done for now?
I don't want to leave you hanging and I'd like to leave (it's late afternoon or early evening here)
 
Well, I just got it going again with the dao code you just posted. Though it still converted my databast to access 2000 format.

Am I missing a step?

BRian
 
THANK YOU CCLINT.

I got it working without using the datacontrol object just used my Dim-ed variables and it kept the format. Though in all my shuffling I am not sure what made it like to stay using 2002 format but it works now. Thanks Again. You are a great help to all people on this site. (I have read many of your posts and have learned a lot at the feet of the master.)

Thanks again.

Brian
 
The code will not convert the database from '97 format to 2000 format (JET 3 to JET 4). Jet 4, or DAO 3.6 is backward comp.
You may have a problem though if you are doing a Database Compact with the DBEngine 4.
Then you should let JRO do the compacting where you can define the format (JET 3 or 4) (you just cannot compact backwards)
 

Hey, thank you, and...anytime!

Now, it's very hot here, and I got a beer awaiting for me...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top