R
Rob Green
I am trying to maintain different state for filenames, so i have a table
with the list of filenames, then in the main table i would link the filename
field to it. However this looks like it is duplicating the actual filename
for each record (i have 100,000's of them so this is bad). I have set up
one-to-many relationship and have enforce relationship integrity enabled.
How can i prevent the filename being duplicated per record?
Main table
ID Autonumber (primary key)
FileName Text - related to FileName.Name
Action Text
Filename table
Name Text (Primary key) - related to Main.FileName
Also, i am using ODBC to actually insert the record in the database like so
CHECK(retcode = SQLBindParameter(
hstmt,
1,
SQL_PARAM_INPUT,
SQL_C_WCHAR,
SQL_WCHAR,
255,
0,
(TCHAR*)FileName,
sizeof(FileName),
&FileNameInd));
"INSERT INTO Main (FileName, Action) VALUES (?, ?)"
I thought about adding a ID field to Filename table but that seems overkill
considering the name is unique and is the primary key.
with the list of filenames, then in the main table i would link the filename
field to it. However this looks like it is duplicating the actual filename
for each record (i have 100,000's of them so this is bad). I have set up
one-to-many relationship and have enforce relationship integrity enabled.
How can i prevent the filename being duplicated per record?
Main table
ID Autonumber (primary key)
FileName Text - related to FileName.Name
Action Text
Filename table
Name Text (Primary key) - related to Main.FileName
Also, i am using ODBC to actually insert the record in the database like so
CHECK(retcode = SQLBindParameter(
hstmt,
1,
SQL_PARAM_INPUT,
SQL_C_WCHAR,
SQL_WCHAR,
255,
0,
(TCHAR*)FileName,
sizeof(FileName),
&FileNameInd));
"INSERT INTO Main (FileName, Action) VALUES (?, ?)"
I thought about adding a ID field to Filename table but that seems overkill
considering the name is unique and is the primary key.