Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a new database in Microsoft Access VBA

Status
Not open for further replies.

afryer

Programmer
Mar 9, 2004
207
GB
Hi All,

I am running an application in Microsoft Access and within that I need to create a new database. I have managed to do this, using the CreateDatabase method, but I also need to do the following. If anyone could help with this then I would appreciate it:

- I need to create a new Module in the remote database and import a .BAS file into it using the AddFromFile method.
- I need to create table links from a database on the server into the new database.
- I need to change some of the permissions in the new database so that some of the users have different read/write permissions.

Thanks in advance

Andrew
 
Can you please post any code that you are using currently and note where it is failing.

Thanks


Andy Baldwin

"Testing is the most overlooked programming language on the books!
 
Hi,

Basically what I am doing is a conversion from Access 97 to Access 2003. The original 97 database was protected using some custom-built security to which we don't have access or the source code, hence I am having to duplicate the functionality the best I can. The main functions of the application are as follows:

- The application consists of a client app, which is installed on the user machines and a server database to which the client app connects using the linked table mechanism. At the moment the tables are defined as reading from a database in the server (as on live), but for testing purposes the back-end database will be stored locally and the links need to be updated.
- The actual back-end database has loads of security restrictions on meaning that we cannot open it in 2003. The only way I have found of doing this is to create a new database and import all of the objects from the original one. I can create a new database using code, but can't import the tables/queries/reports etc and that was one of the questions I asked previously.
- In addition to this the backend database also makes use of a module and macro, which runs at startup and checks that the user is logging in using a user-defined workgroup file, not the system one and flags and error if they are not. I also need to import this module into the database.
- The way the workgroup is currently set up is that each of the users is a member of the USERS group, which allows full read/write permissions. The customer has requested that anyone who accesses the back-end database directly only has read permissions and at the moment I am using the following manual steps to do this:
- remove all permissions except read from USERS
- create another group with full permissions
- attach all current users to this new group.
- create a new user, which is simply connected to users
- Check at startup to see if this new user has logged on and if not then exit (done in the aforementioned security module).

I need to do this in code as well.

As it stands I have an installation document, which outlines the manual steps to do this, but it would be nicer to do it in code if possible.

Cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top