Results 1 to 7 of 7
  1. #1
    Deaf_Smith is offline Novice
    Windows 8 Access 2013 32bit
    Join Date
    Jun 2016
    Location
    Texas
    Posts
    4

    How to create a new Access db that matches another one

    I have to create 150 Personal GeoDatabases, all with different names that match a particular survey number.

    Like 227-1, 444-1, 459-1, etc.

    I have an empty Access DB that already has all the definitions and want to 'clone' the empty one to the new ones with their new names (and each table in them has, at the end of the name, the same survey number.

    Can this be easily done or do I have to do it by hand by copying the access db and renaming all the tables as well as the db name.

    Thanks,

    Paul

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    What exactly is a Personal GeoDatabase?
    How did you determine the 150 as compared to 120? I'm just curious.

    Perhaps you could post a copy of this empty template to help the rest of us understand.

    I have an empty Access DB that already has all the definitions
    I found this definition, but I'm not clear on its purpose and why it would have to be in MS Access.

  3. #3
    Deaf_Smith is offline Novice
    Windows 8 Access 2013 32bit
    Join Date
    Jun 2016
    Location
    Texas
    Posts
    4
    The county codes (here in Texas) are to be used to make them. CountyCode_MapGrid_county# (with the county# being the county id number, say 212 for Rusk County.)

    And the tables in the DB have names like Block_mapgrid_county#. Same layouts for each table but with the county number at the end of the table name.

    Paul

  4. #4
    Deaf_Smith is offline Novice
    Windows 8 Access 2013 32bit
    Join Date
    Jun 2016
    Location
    Texas
    Posts
    4
    Quote Originally Posted by orange View Post

    I found this definition, but I'm not clear on its purpose and why it would have to be in MS Access.
    Yes that is basically what it is for. For each of the Texas counties they want a DB, using the county code as part of the name. Inside each of the counties will be several layers of spatial data for maps.

    Paul

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Perhaps you could post a copy of this empty template to help the rest of us understand.
    And if you show an example of what you want as an end product, I'm sure you'll get focused responses.

  6. #6
    Deaf_Smith is offline Novice
    Windows 8 Access 2013 32bit
    Join Date
    Jun 2016
    Location
    Texas
    Posts
    4
    Well I have a better way (at least I can get the DB names right. But I had to use Python! Here is the code:


    #************************************************* **************
    # Name: CreatePersonalGDB_Example2.py
    # Description: Create a personal GDB
    # Author: ESRI


    #
    # Import system modules
    #
    import arcpy
    from arcpy import env


    # Set workspace
    env.workspace = "C:/data"


    #
    # Set local variables
    #
    out_folder_path = "C:/output"
    out_name = "CountyCode_MapGrid_"
    mdb = ".mdb"
    #
    # array of counties (just a small sample here.)
    #
    arr = {"003-170","003-176","003-220"}


    #
    # Create the Dbs!
    #
    for name in arr:
    arcpy.CreatePersonalGDB_management(out_folder_path , out_name + name + mdb)
    #************************************************* **************


    output folder has access dbs:


    CountyCode_MapGrid_003-170
    CountyCode_MapGrid_003-176
    CountyCode_MapGrid_003-220




    But inside each DB, the tables still have their default names, which is ok,
    but there are other empty tables I want inside the DBs that have the same county code names appended like:


    Block_xxx
    Block_xxx_SHAPE_Index


    Where the xxx will be the same as "003-170","003-176","003-220" in the array.


    How to copy the tables from one DB to another and if possible rename them to match the county names and surveys. That is the problem.


    Thanks.

  7. #7
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,870
    Glad you have a solution.

    You could do this in Access. (general approach)

    You have a template , call it c:/data/template.mdb
    You have a list of counties, Counties

    Code:
    For each County
          get a copy of the template
                Create Table... for whatever you need based on the county
                Add the table to this copy of the template database  
      
          place the adjusted template into a database in output folder via a function
                             CreatePersonalGDB_management(out_folder_path  , out_name & name & mdb)
    next County

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 02-29-2016, 06:13 PM
  2. Finding matches between two TABLES
    By DAbbot in forum Queries
    Replies: 4
    Last Post: 11-13-2015, 08:28 AM
  3. If no matches Reopen form after Msgbox
    By LoveLearning in forum Access
    Replies: 2
    Last Post: 07-18-2012, 06:08 PM
  4. Access to filter semi matches.
    By Shido151 in forum Queries
    Replies: 1
    Last Post: 04-23-2012, 06:14 PM
  5. Partial Matches in a Parameter Value
    By Darkladymelz in forum Access
    Replies: 18
    Last Post: 03-06-2012, 12:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums