Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Duplicate primary key
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Duplicate primary key
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01423254
Message ID:
01423254
Views:
121
Hi,
I have a customer that transfers information between 2 systems. both are VFP applications and have the exact same file structure, VFP databases. I take a call from system A and create a dbf with the call number on it an dplace it in a particular folder, there are memo fields so I end up with 2 files 1234.dbf and 1234.fpt.
System B has an import button, when you click on it the code reads all of the files in a folder into an array and then checks the file name against the primary key field. if it find a match it skips the file, if not then it appends the contents of the file. the problem is that every so often a file might be exported a second time and therefore exist in the System B table but the code does not find a match on the primary key but when it goes to append it a primary key violation comes up. if i go out of the application and back in the problem still persists, it never finds the call number on the table but fails on the append.
I read the files in using
ADIR(myarray,'*.dbf')
and use a seek on the table using the index on the primary key
anyone any idea how to get around this?
~M
Go raibh maith agat

~M
Next
Reply
Map
View

Click here to load this message in the networking platform