RotoGuru Baseball Forum

View the Forum Registry


Self-edit this thread


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
1SillySpheres 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:
5 (top notch)
4 (even better)
3 (good stuff)
2 (lightweight)
1 (no value)
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.

RotoGuru Baseball Forum

View the Forum Registry


Self-edit this thread




Post a reply to this message: (But first, how about checking out this sponsor?)

Name:
Email:
Message:
Click here to create and insert a link
Click here to insert a random spelling of Mientkiewicz
Ignore line feeds? no (typical)   yes (for HTML table input)


Viewing statistics for this thread
Period# Views# Users
Last hour11
Last 24 hours11
Last 7 days33
Last 30 days66
Since Mar 1, 2007968461