problem with recordset

  • Thread starter Thread starter ma
  • Start date Start date
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
 
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.
 
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
 
Back
Top