0 |
Subject: WAY OT - VB code - How to access database
Posted by: Monster
- [33482621] Thu, May 01, 2003, 22:30
Hi, this is really off topic. If you guys want me to delete it, I will.
I'm pretty new to VB. I just learned to create a database file from Access.
now i want to be able to access the database for info in the program.
so far, I've found two supposed way of doing this.
First one was really complicated and I didnt understand it.
Second way was from this book called VB Bible. It basically says use this
Dim DB as Database Set DB = OpenDatabase("filelocation")
then to access the stuff
Dim rs as recordset set rs = db.openrecordset("name", dbopenDynast")
when I try this. first error msg i get is that Database is not proper user-defined type. then it doesnt recognize the function OpenDatabase, not to mention the openrecordset.
Could someone give me some help? Thanks |
1 | SillySpheres at Work
ID: 582492810 Thu, May 01, 2003, 22:41
|
Did you set up the database as an ODBC source? If I recall correctly, you need to have the database "registered" with windows via the ODBC interface in order to access it via VB.
|
| Rate this thread: | If you wish, you may rate this thread on scale of 1-5. Ratings should indicate how valuable or interesting you believe this thread would be to other users of this forum. A '5' means that this thread is a 'must read'. A '1' means that this is a complete waste of time. If you have previously rated this thread, rating it again will delete your previous rating. If you do not want to rate this thread, but want to see how others have rated it, then click the button without entering a rating, or else click here. |
|
|
Post a reply to this message: (But first, how about checking out this sponsor?)
|