BE database

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi there

I just separated my database into a front end and back end. What I didn't forsee was some of the code I use has the followin

dim dbs as dao.databas

set dbs = Currentd

Well, this doesn't work for somethings now that the tables are actually in my back end db. Can someone tell me how to declare and set the db to reference my ie. C:\Mydocuments\db1.mdb (backend db - file path is just example

I tried set dbs = "C:\....." but I got a type mismatch error and I think it's because of the dim dbs as dao.database declaration

Does anyone know what I need to do to remedy this
Thanks in advanc
Shawna
 
Assuming you've got linked tables in your front-end pointing to the tables
in your back-end, CurrentDb will still work.

Otherwise, you need to use

Set dbs = OpenDatabase("C:\...")

or (more correctly)

Dim wsp As DAO.Workspace
Dim dbs As DAO.Database

Set wsp = DBEngine.Workspaces(0)
Set dbs = wsp.OpenDatabase("C:\...")


--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Shawna said:
Hi there,

I just separated my database into a front end and back end. What I didn't
forsee was some of the code I use has the following
dim dbs as dao.database

set dbs = Currentdb

Well, this doesn't work for somethings now that the tables are actually in
my back end db. Can someone tell me how to declare and set the db to
reference my ie. C:\Mydocuments\db1.mdb (backend db - file path is just
example)
I tried set dbs = "C:\....." but I got a type mismatch error and I think
it's because of the dim dbs as dao.database declaration.
 
If you have them linked, the only thing that wont' work
anymore is using a .Seek.

Also, make sure you have a reference to DAO set.


Chris Nebinger

-----Original Message-----
Hi there,

I just separated my database into a front end and back
end. What I didn't forsee was some of the code I use has
the following
dim dbs as dao.database

set dbs = Currentdb

Well, this doesn't work for somethings now that the
tables are actually in my back end db. Can someone tell
me how to declare and set the db to reference my ie.
C:\Mydocuments\db1.mdb (backend db - file path is just
example)
I tried set dbs = "C:\....." but I got a type mismatch
error and I think it's because of the dim dbs as
dao.database declaration.
 
Thank you for your reply
I found that most of my code works but for one command button I
(in psuedocode

setdb = currentd

run an update qry to a temp tabl
count the records in that temp table and store in variabl

then I run a select qry on another table and count those record

If the count = in both tables then I run another update qry

With my linked table the record counts did not match - even though in the actual tables the count of records was equal
As soon as I made the temp table a part of the fe db this cmd button worked again
Any ideas

Thank you
Shawna
 
Without seeing the real code, I have no idea why that would be.

--
Doug Steele, Microsoft Access MVP

(No private e-mails, please)



Shawna said:
Thank you for your reply.
I found that most of my code works but for one command button I
(in psuedocode)

setdb = currentdb

run an update qry to a temp table
count the records in that temp table and store in variable

then I run a select qry on another table and count those records

If the count = in both tables then I run another update qry.

With my linked table the record counts did not match - even though in the
actual tables the count of records was equal)
 
Back
Top