Solved

Access 97 Back end Update

Posted on 2014-01-13
4
493 Views
Last Modified: 2014-01-13
Good Morning All,
          I have recently finished updating the front end of my companies database. To bring things in line with what they wanted I have had to add fields to some of the back end tables. Now I find my self almost ready to go live and stuck on how to move the current data in to the new tables. I have tried using different query but I'm new at Access 97 so I'm sure i'm missing something. i'm getting key violations on the append query which looks like the one I should use. please help.
                                 Thank you for your time
                                                            DWG
0
Comment
Question by:Denthion
4 Comments
 
LVL 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 39776688
Don't know whether the backend has any relationships defined, but if it does, then you must load the tables in the proper order.  Those tables on the one side of one-to-many relationships must all be loaded first, otherwise, you will get those foreign key errors.
0
 
LVL 31

Expert Comment

by:Helen_Feddema
ID: 39777048
New at Access 97???  That version is almost 20 years out of date.  I suggest upgrading to Access 2010.  Much work will need to be done to upgrade code, but it should be done now, as you may not even be able to open Access 97 databases in current Access versions before long.
0
 
LVL 35

Accepted Solution

by:
PatHartman earned 500 total points
ID: 39777444
Access 97 is an oldy but a goody but I agree with Helen.  It's time to come into this century and I would do it with A2010 if at all possible.  I don't even know if you can still buy it but if you can, you should get it while it is still available since A2013, which is the current version can no longer read A97 databases at all.  I guess MS couldn't get people to give up A97 and so they decided to force the issue.

How to convert the data depends a lot on the type of changes you made.  If it was basically adding columns, changing column definitions, adding/deleting indexes, you can use DDL queries to make the old database conform and not have to reload all the tables.

Look up Data Definition Language in Access help (from a code window NOT from the GUI) or on the Web for examples of the types of queries you will need to create.  Here's an example to add a column to a table:

ALTER TABLE Employees ADD COLUMN Notes TEXT(25)

You can add multiple columns at once.

Here's another to change a column definition:

ALTER TABLE Employees ALTER COLUMN ZipCode TEXT(10)

Here's an example that is more complicated.  It is in VBA but it doesn't have to be.  You can just create the query directly.

This example creates a new table called MyTable with two text fields, a Date/Time field, and a unique index made up of all three fields.



VBA


Sub CreateTableX2()
 
    Dim dbs As Database
 
    ' Modify this line to include the path to Northwind
    ' on your computer.
 
    Set dbs = OpenDatabase("Northwind.mdb")
 
    ' Create a table with three fields and a unique
    ' index made up of all three fields.
    dbs.Execute "CREATE TABLE MyTable " _
        & "(FirstName CHAR, LastName CHAR, " _
        & "DateOfBirth DATETIME, " _
        & "CONSTRAINT MyTableConstraint UNIQUE " _
        & "(FirstName, LastName, DateOfBirth));"
 
    dbs.Close
 
End Sub
0
 

Author Closing Comment

by:Denthion
ID: 39777710
Thank you, This is the kind of information i was looking for.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question