Hi,
I'm trying to connect to a Access 2000 MDB with a VB6.
From all the options around and with the little knowledge I got - I'm quite lost! :)
After reading several answers from the archive, I've got to some point, but still far from the end.
I want to work only with code if possible. I try to stay away from data controls as much as I can because I want to log into the DB once and create recordsets and querydefs quite often. (btw, can you plz write in a word or two what's the main difference between them!? thanks!)
The things I got so far:
In the project's references I got:
Microsoft DAO 3.6 Object Library,
Microsoft ActiveX Data Objects 2.5 Library, and Microsoft Data Binding Collection (if it got anything to do with this...).
In the Code:
' Global DB:
Public gDB As Database
' Connection with DB:
sTempDBDir = App.Path & "\whatever.mdb"
Set gDB = DBEngine.OpenDatabase(sTem
pDBDir)
' Openning a Recordset:
Set rstOutput = gDB.OpenRecordset(strTempS
QL)
' Everything works just fine till here, I can get the recordcount from this recordset and do all the stuff with it. now I want to connect this recordset to a listbox (it's a HUGE recordset, around 100K list. yep. it's time to move to Oracle, don't you think?). Now, I don't know if I should use a DBList or a ListBox, how the connection should work and what's the plain syntax for it...
Now, there's a good chance I got it all wrong, and this is NOT the best way to connect to an Access 2000 DB, and I should use the Adodb objects, I really don't know, I never had to work on windows 2000 with office 2000 and VB 6...
I'd appreciate it a LOT if you'll write a simple application that connects to a new version MDB, makes some SQLs in it, connects it to a list box or whatever and closes the DB at the end. I'd like to know how to do it with Code only and with objects only.
If you need any more info about how and what I use - I'll check this question (on my) tomorrow. thanks!
Thanks very VERY much,
Offir. :)
P.S:
I've put quite a high amount of points, PLEASE be very clear and elaborate on the answer as much as you can. I'm quite tired searching for info on the web regarding Access 2000 and VB... where do they hide this info?! :-\ If you got some URLs that could help me, I'd love to read those too!...
Again, Thanks and have a GREAT day.
Offir. :)
Start Free Trial