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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't use OpenDatabase method in Excel VBA???

Status
Not open for further replies.

Paladyr

Programmer
Apr 22, 2001
508
US
When I try to do the following:

Code:
Dim strCnn As String
Dim dbFac As DAO.Database
Dim db As DAO.Database

Dim rst As DAO.Recordset  
 
  Set db = db.OpenDatabase _
  ("C:\Projects\CustomReports\ctx2000.mdb", _
  False, False, "MS Access;PWD=****")
[\code]

It highlights the .OpenDatabase and says member not found.  I have the "Microsoft DAO 3.6 Object Library" reference installed, and still can't do this.  Any ideas?  Am I supposed to be able to do this or do I need a "Developer's License" like the one you get with visual basic?  Thanks!
 
Okay, now I am trying it in visual Basic and it is giving me the same message. I have the same references installed. What could be wrong?
 
Well, maybe I'm wrong on the VB. I tried to import the forms I created in Excel and that is where this opendatabase method is being used, however the forms don't show up under forms, they are under a folder called designer. I'll try creating a new form in VB and see if it works.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top