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

Error 3078

Status
Not open for further replies.

zoroaster

Programmer
Jun 10, 2003
131
GB
We have a series of databases which we've been using successfully for a few years now, all in Access2003, which has been converted from 97 a year or two ago now. All of a sudden they've all been failing on the following bit of code:
Code:
Dim DB1 As DAO.Database
    Dim RS1 As DAO.Recordset
    Dim SD As Date

    Set DB1 = DBEngine.Workspaces(0).Databases(0)
    [HIGHLIGHT]Set RS1 = DB1.OpenRecordset("Q_RUNTIMES", dbOpenDynaset)[/HIGHLIGHT]
on which I get a "Run-time error '3078' (The MS Jet database cannot find... 'Q_RUNTIMES'...)" The query 'Q_RUNTIMES' does exist, I can open it from within the database window, and it's spelled correctly within the code. I discovered, more by accident than design, that if I change the reference to the database from
Code:
Set DB1 = DBEngine.Workspaces(0).Databases(0)
to
Code:
Set DB1 = CurrentDb
it works again. What I don't understand is why?

Laters, Z

"42??? We're going to get lynched!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top