problem with recordset

M

ma

hello,
I am new in VBA for access and I wrote the following simple code but it
doesn't work properly:

Dim wrkJet As Workspace
Dim db As Database
Dim mytable As Recordset

Set wrkJet = CreateWorkspace("", "admin", "", dbUseJet)
Set db = wrkJet.OpenDatabase("c:\jila_databse.mdb")
Set mytable = db.OpenRecordset("tblEpisodes", dbOpenTable)


the error is that type mismatch and it points to the line that opens
recordset. what is the problem?

Best regards
 
D

Dirk Goldgar

ma said:
hello,
I am new in VBA for access and I wrote the following simple code
but it doesn't work properly:

Dim wrkJet As Workspace
Dim db As Database
Dim mytable As Recordset

Set wrkJet = CreateWorkspace("", "admin", "", dbUseJet)
Set db = wrkJet.OpenDatabase("c:\jila_databse.mdb")
Set mytable = db.OpenRecordset("tblEpisodes", dbOpenTable)


the error is that type mismatch and it points to the line that opens
recordset. what is the problem?

Best regards

See my reply to youir earlier post. In general, you should be prepared
to wait at least a day before reposting the same question. Newsgroups
are not chat rooms.
 
O

Ofer

If the code you are writing is in c:\jila_databse.mdb with the tables then
you can write the code as follow

Dim db As Database
Dim mytable As Recordset

Set db = codedb() 'Current DB
Set mytable = db.OpenRecordset("tblEpisodes")

just a note
 

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