Open a DB from within another access DB

  • Thread starter Thread starter Colin
  • Start date Start date
C

Colin

Hi Iam new to writing code and would like some help in
opening a database from within an existing database.

The code is as follows:

Function Uploaded()

Dim DB As String
DB = "\\Server\billing\Billing Archive\2004\Datastore
test Area\Upload.mdb"
OpenDatabase "DB"
End Function

However I get an error code 3024 Could not find file "DB"

Having defined DB as the connect string including the
database name, where am I going wrong?

Please accept my thanks in anticipation

rgds Colin
 
Exactly what do you mean by "opening a database"? Do you mean opening the
another database application with forms and such? Or do you want to open a
database in code so that you can programmatically modify its data? These
are two different things. In the first, you will actually see the database
you are opening. In the second, you will never see the database on the
screen.
 
Piggy-backing on your post, Roger, because I don't see the original.

In addition to your points, with which of course I agree, it may be worth
noting that the code that Colin posted is using the literal value "DB" where
he probably intended to use the variable DB. Note the quotes around "DB" in
the last line below ...

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
Back
Top