Discussion Locked

Access97 Problem

0 helpful
15 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am creating a database in Access97 and ran into a problem. The table I was working in had too many fields in it. So I decided to create a second table but I'm having problems connecting the two tables. The problem is that the whole database search fields & Queries uses this first table and I need to include it in linking the forms. Is there a way to link the 2 tables so that it acts as one? Or is there a way to increase table one fields so that I can just use the original table? HELP.....

15 replies

by xchen

Since the whole database uses the first table for searching, it would be better to keep only the first table. To add more fields to the table, open the table in table design view, then add any fields you want. Note that you can only modify the tabledesign in the database where the table is defined, not in the database which provides a link to the table.

by garethreynolds

If you join the tables in a one-to-one relationship (it would help if they have identical primary keys) selecting all fields from each then you can use the query pretty much as a table.

It's also worth checking that the tables have the smallest possible field sizes ie never use Double when you can use Long, and never use Long when you can use Integer

by jds

First of all, do yourself a favor and get a good book on data normalization (I recomend: "Access 97 Developer's Handbook"
by Paul Litwin, and Ken Getz, it sells on Amazon for $48.)
MS Acces allows for 255 fields (as per the specs) in a table. I cannot foresee a good reason why one should need to know 255 things about an object without using one to many relationships at some point.
Again, my advice to you is to get a good book and take a bit more time to develop the data structure. It will take more time in the beginning and add some complexity, but the rewards reaped in the end will be worth it.
If that is not a viable option then take the previous writer's advice and add an identicle primary key to both tables and link themone-to-one. Make sure that the table that you really need the most is on the left side of that link so that it's record can exist without the other table's coresponding record.
Good luck, and happy programming.

by ralanis

Yes, There is a way to connect two tables so they act as one. First, insert a new field in both of your tables with the Data Type of AutoNumber. Be sure to name your new fields with the same name. Then create a query and link your two tables withthe new field and bring down all the fields of your tables in the query grid. Now save your new query so you can use it in a form.

Good Luck...
ROA

by creative

The infomation above is good. There is one more thing to think of though, if youo not need to search all the fields, you can have another table linked in, but not necesarily with all the records shown in the qry, rather, place the entire table in the qry by double clicing the * symbol in the table, this way all fields are available to you.

Creae a couple of queries to hold your data and pop them in where you need it.

Please note though - as stated above - if you need 255+ data fields, youprobably need to look into normalization in a big way...

by max_in_oh

First off, the advice about getting a good book will pay many dividends in time and frustration savings. Second, take a good look at the data you are trying to manipulate. Based on the releationships of the data, create separate tables for any field you have duplicated many times in adjoining records. If you break your flow, then tweak or revise your queries to pull the data. Duplicating data in your database will cause quick unrecoverable bloat and slow down access to the records you are searching for. For instance, say you have 20 fields that are the same for 400 records, the 20 "fields" can be stored as a table and only the reference to the table item will have to be stored in the new data. Look into relational database models andyou will see a much more stable data environment, and in the end you will find it easier to manipulate by linking like items in separate tables. You can set relationships just as easy as trying to name and manage one table with 200 fields. Storagemay not seem like an

by donq

Rule 1: all Data MUST be "atomic" which means your business does not EVER need any stored (Field) value broken down any further. Rule 2: every Table MUST contain data about one subject ONLY. When you talk about your company business the "nouns", "adjectives", and "verbs" make excellant Table candidates. Rule 3: Each Field in any Table MUST store a Fact value related to the table "subject" ONLY (i.e., Elployees might contain empLname, empFname, empSS#, enpAddress, empCity, empShoeSize, emp). And finally Rule 4: EVERY Table row (or Record) represente a seperate INSTANCE of the Table Subject that can be indexed via a PRIMARY KEY.

This discussion is closed to new replies.