back end mdb

  • Thread starter Thread starter emiel.alkemade
  • Start date Start date
E

emiel.alkemade

hello,

I splitted my mdb and got stuck with the following declarations and
index setting:

in my original mdb i did the following :

1 - Public pDb As DAO.Database
2 - Public pRstPers As DAO.Recordset

3 - Set pDb = CurrentDb
4 - Set pRstZoek = pDb.OpenRecordset("tblPERSZOEK", dbOpenTable)
5 - pRstZoek.Index = "PrimaryKey"

with the mdb back end :

the first error occurs at line 4 -> dbOpentable
after removing that
the second error occurs at line 5 (of course ir is not supported
without dbOpentable)

how do I solve this problem?

please let me know.
 
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

That is the default action when the data is in a linked table.

When reading linked table data I usually set the recordset as a dynaset
or snapshot and use the .Find methods instead of the .Seek method.

To get your code to work you'd have to open another instance of Access
(the back-end) and use instance variables to access the back-end. I
don't recommend this 'cuz it uses up more of your PC's RAM and could
slow down the application. E.g.:

1 - Public pDb As DAO.Database
2 - Public pRstPers As DAO.Recordset

' The instance variable "objAcc" - early binding
a - dim objAcc as Access.Application
b - set objAcc = GetObject("c:\myBack-End.mdb","Access.Application")

' Use the instance variable to refer to the back-end
3 - Set pDb = objAcc.CurrentDb
4 - Set pRstZoek = pDb.OpenRecordset("tblPERSZOEK", dbOpenTable)
5 - pRstZoek.Index = "PrimaryKey"

See the Access Help articles GetObject Function and CreateObject
Function for more info.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQQkZbIechKqOuFEgEQLSCwCeIO5qSCEWULVBbL/t4fqnHwmU+r4An1HP
Cmq4xUu6gLR59rB1BK/XbvlN
=xssP
-----END PGP SIGNATURE-----
 
Back
Top