R
Roger Spencelayh
I've inherited an Access 2000 database, and the client is having a few
problems with it. The first is that it is very slow, and secondly,
we're getting data added multiple times from some code which imports
data from an Excel workbook.
There are 2 tables contributing to the problem. The first contains
information about the Workbook - PK is the workbook name, and the other
holds information read from the workbook - a maximum of 10 records from
each workbook.
The data is read in from code which reads the contents of a folder
using the FileSystemObject, and writes the file name plus a couple of
fields from the book into the first table. It then reads some other
data from the book, and writes the file name, an ID from 1 to 10, and
other information from the book into the second table.
Run the code by hand in debug mode, and all is fine. Let it run
normally from a button on a form, and it may add the detail once,
twice or three times.
The crunch is that this second table has no primary key. Could that
contribute to the problem? What is the effect of not having a primary
key?
I will make FileName + ID the PK, but I'm interested in the real world
effect of having no PK
problems with it. The first is that it is very slow, and secondly,
we're getting data added multiple times from some code which imports
data from an Excel workbook.
There are 2 tables contributing to the problem. The first contains
information about the Workbook - PK is the workbook name, and the other
holds information read from the workbook - a maximum of 10 records from
each workbook.
The data is read in from code which reads the contents of a folder
using the FileSystemObject, and writes the file name plus a couple of
fields from the book into the first table. It then reads some other
data from the book, and writes the file name, an ID from 1 to 10, and
other information from the book into the second table.
Run the code by hand in debug mode, and all is fine. Let it run
normally from a button on a form, and it may add the detail once,
twice or three times.
The crunch is that this second table has no primary key. Could that
contribute to the problem? What is the effect of not having a primary
key?
I will make FileName + ID the PK, but I'm interested in the real world
effect of having no PK