dao syntax error, Help!

?

********

In the following code I get a "can't find program or library" error on this
statement

Set db = OpenDatabase("roncheck1.mdb").

Am I missing a library that doesn't come with access? Please help. Thanks.
Private Sub db_betw_dates_obj_MouseDown(Button As Integer, Shift As Integer,
X As Single, Y As Single)
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim strSQL As String

Set db = OpenDatabase("roncheck1.mdb")
strSQL = "select * " _
& "where DATE Between " _
& "#[start_date_cal.value]# And #[end_date_cal.value]#;"
Set rs = db.OpenRecordset(strSQL)
End Sub
 
D

Dirk Goldgar

******** said:
In the following code I get a "can't find program or library" error
on this statement

Set db = OpenDatabase("roncheck1.mdb").

Am I missing a library that doesn't come with access? Please help.
Thanks.

Does it work if you write

Set db = DBEngine.OpenDatabase("roncheck1.mdb")

?
 
J

John Vinson

In the following code I get a "can't find program or library" error on this
statement

Set db = OpenDatabase("roncheck1.mdb").

Am I missing a library that doesn't come with access? Please help. Thanks.

Probably it's just not correctly linked.

This appears to be the very common References bug. Open any
module in design view, or open the VBA editor by typing
Ctrl-G. Select Tools... References from the menu. One of the
..DLL files required by Access will probably be marked
MISSING. Uncheck it, recheck it, close and open Access.

If none are MISSING, check any reference; close and open
Access; then uncheck it again. This will force Access to
relink the libraries.

If none are missing, be sure that the Microsoft Access DAO 3.6 (or
highest) version reference is checked. A2000 did not open this library
by default - you need to explicitly check it.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top