referring to a recordset after splitting a database

  • Thread starter Thread starter ann
  • Start date Start date
A

ann

I used the database splitter to split my database in to a
front and back end. I am now having trouble referring to
recordsets that are in the back end. In a few part of my
database I used the following type of code:

Dim cnn As Connection
Dim rstRequest As New ADOBD.recordset

Set cnn = CurrentProject.Connection
rstRequest.Open "Request", cnn, adOpenKeySet,
adLockOptimistic, adCmdTableDirect.
cnn.BeginTrans

Now that I have split the database it is looking for the
table request in the front end but it is in the back end.
How do I change the connection to the back end?
 
ann said:
I used the database splitter to split my database in to a
front and back end. I am now having trouble referring to
recordsets that are in the back end. In a few part of my
database I used the following type of code:

Dim cnn As Connection
Dim rstRequest As New ADOBD.recordset

Set cnn = CurrentProject.Connection
rstRequest.Open "Request", cnn, adOpenKeySet,
adLockOptimistic, adCmdTableDirect.
cnn.BeginTrans

Now that I have split the database it is looking for the
table request in the front end but it is in the back end.
How do I change the connection to the back end?

I'm not sure I understand. Normally when you split your database the
front-end has linked tables to the tables in the back-end, and your code
should work to open a recordset on such a linked table, without your
having to specify the connection to the back-end. I'm not an expert on
ADO by any means, but I just tried it and it worked fine. What exact
error are you getting?
 
Depending on where I have used the connection I am getting
different error messages. In the case below I receive a
compile error: Method or data memeber not found. In
other places I get data type mismatch. In all of these
case, the files that uses the connection are temporary
files that I have stored on the front end database.
 
ann said:
Depending on where I have used the connection I am getting
different error messages. In the case below I receive a
compile error: Method or data memeber not found. In
other places I get data type mismatch. In all of these
case, the files that uses the connection are temporary
files that I have stored on the front end database.

Do you have a reference set to the ActiveX Data Objects 2.x Library?

I notice now that in the code you posted you say:
Dim rstRequest As New ADOBD.recordset

Was that a cut and paste from your code? It shouldn't be "ADOBD", it
should be "ADODB". Maybe you introduced the error in transcribing the
code for posting, but if that's what you have in your actual code it
will certainly give an error message.
 
Back
Top