Rename An External Database

A

Arturo

Access 2003 - I have a database named TestA and a database named TestB.
Inside TestA is a table tblID with a field named IDNum, i.e., tblID.IDNum.
The value in IDNum is T1.

When I close the database TestA, I want Access to rename TestB to T1TestB.
This is a concatenation of “tblID.IDNum†and the name of the database TestB.

Can anyone tell me how to do this?

Thanks for your help.
 
A

Arturo

I got this from a previous post and it works well for what it is supposed to
do, rename a file.

Name "C:\Folder\TestA.mdb" As "C:\Folder\TestAB.mdb"

However, I still need to add the IDNum from a table to the front of the
file. I need this very badly. Somebody jump on this. I know you can do it.

Thank you.
 
J

John W. Vinson

I got this from a previous post and it works well for what it is supposed to
do, rename a file.

Name "C:\Folder\TestA.mdb" As "C:\Folder\TestAB.mdb"

However, I still need to add the IDNum from a table to the front of the
file. I need this very badly. Somebody jump on this. I know you can do it.

Thank you.

First question is.... WHY!!!? are you apparently creating a new *database*
based on a single record in another database? Storing data in a fieldname is a
bad idea; storing it in a tablename is worse; storing data in the name of a
database container file on disk is downright dreadful!

That said...

Name "C:\Folder\TestA.mdb" As "C:\Folder\T" & DLookUp("IDNum", "tblID",
<optional criteria>) & "TestB.mdb"

I don't know how you plan to determine WHICH of the (presumably multiple) ID
values in tblID to use; that would go in the "optional criteria". If there's
only one record you can leave that argument blank.

But do let us know why on earth you're trying to do this very strange
exercise!
 
A

Arturo

First, the table with the IDNum will be one record.

Secondly, I will have over 200 sites using a copy of the same database. Each
site will have a FE and two BE databases which will reside in a folder on
their C:\Drive. BE #1 will be their data repository and will hold the IDNum.

BE #2 will receive any additions or changes to their records. When they
close their FE, I need the program to rename BE #2 with that IDNum and the
name of the BE #2 database. This will be sent to an FTP site. So, as many as
200 files with the same name could be there, which won’t work. I could use
the date but I may need to be able to quickly identify one of these files.
That is why I need the IDNum at this time.

Once a day I will have a script download all these files, open them one at a
time, and they will run a procedure that will append new records to my Main
database and update any changes. Then the file will close. In about a year we
will have a different process in place, but I need this now to begin the
program.

Thanks.
 
J

John W. Vinson

First, the table with the IDNum will be one record.

Secondly, I will have over 200 sites using a copy of the same database. Each
site will have a FE and two BE databases which will reside in a folder on
their C:\Drive. BE #1 will be their data repository and will hold the IDNum.

BE #2 will receive any additions or changes to their records. When they
close their FE, I need the program to rename BE #2 with that IDNum and the
name of the BE #2 database. This will be sent to an FTP site. So, as many as
200 files with the same name could be there, which won’t work. I could use
the date but I may need to be able to quickly identify one of these files.
That is why I need the IDNum at this time.

Once a day I will have a script download all these files, open them one at a
time, and they will run a procedure that will append new records to my Main
database and update any changes. Then the file will close. In about a year we
will have a different process in place, but I need this now to begin the
program.

Thanks for the explanation. That does sound mainly reasonable! Did my
suggested code help?
 
K

kate

"John W. Vinson" <jvinson@STOP_SPAM.WysardOfInfo.com> a écrit dans le
message de groupe de discussion :
(e-mail address removed)...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top