By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,475 Members | 1,367 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,475 IT Pros & Developers. It's quick & easy.

Create Empty Access DB From an Existing Access DB

P: 2
I have a production access application with no development environment. We need to create a develoment access environment with an empty db. We are not allowed to see the production data. How do I create a template of the existing db and then use it to create my development environment
Jul 19 '07 #1
Share this Question
Share on Google+
6 Replies


NeoPa
Expert Mod 15k+
P: 31,186
This all really depends on what you mean by "with no development environment".
If it's not an MDB file and you don't have the MDB file it was created from, then it appears that someone has made a grand faux-pas.
Is that what you're trying to say?
Jul 19 '07 #2

P: 2
This all really depends on what you mean by "with no development environment".
If it's not an MDB file and you don't have the MDB file it was created from, then it appears that someone has made a grand faux-pas.
Is that what you're trying to say?

I do have a MDB file. It has my production forms and data. I can copy it over to the development world. I just need a way of deleting all of the data but keep the tables.
Jul 20 '07 #3

NeoPa
Expert Mod 15k+
P: 31,186
Clearing the data from a single table is simple enough :
Expand|Select|Wrap|Line Numbers
  1. DELETE
  2. FROM [TableName]
You can apply a WHERE clause too if you want to keep any of it.
Jul 20 '07 #4

NeoPa
Expert Mod 15k+
P: 31,186
The following code should be used with caution. Do it only on the copied version.
Expand|Select|Wrap|Line Numbers
  1. Public Sub ClearAll()
  2.   Dim tblThis As TableDef
  3.   Dim strSQL As String
  4.  
  5.   For Each tblThis In CurrentDb.TableDefs
  6.     With tblThis
  7.       If Left(.Name, 4) <> "MSys" Then
  8.         strSQL = Replace("DELETE FROM [%T]", "%T", .Name)
  9.         Call DoCmd.RunSQL(strSQL, False)
  10.       End If
  11.     End With
  12.   Next tblThis
  13. End Sub
Jul 20 '07 #5

NeoPa
Expert Mod 15k+
P: 31,186
Please let us know how well this works for you, or if you come across any Cascaded-Delete type issues.
Jul 20 '07 #6

nico5038
Expert 2.5K+
P: 3,072
Just a warning, first check or the tables aren't linked !

Just open the table in design mode and when there's no warning that you can't change the definition, it's OK.
Linked tables also have an icon with a black arrow.

Nic;o)
Jul 20 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.