We are having an issue with a new application.
It is using 2 FoxPro databases, which both contain a stored procedure
called NewID(), and a table called ID_MASTER where the unique ID's are
located at.
We use the NewID() stored procedure as the default value for our
primary keys, called as NewID('TableName').
But at other times, we need to find out what the ID is before our
insert into the database, to link this ID in child tables for their
inserts.
Pretty straight forward so far.
The problem is that sometimes the newid() stored procedure seems to be
getting called from the wrong database, and it returns the wrong value.
This occurs in both instances above.
An example is:
INSERT INTO MARKIII!demand_order (bin_id, dmd_time_low, dmd_ready,
ord_id) ;
VALUES (laAvailableBins(iCount,1), lnEmptyTime, lbReady, .NULL.)
the primary key is dmd_id, and it has a default value of
NewID('demand_order'),yet sometimes it access the wrong database.
We have listed prior to this code SET DATABASE TO MARKIII, as well as
SET DATABASE TO (this.database_location)
this.database_location is the full path and database name to our
location.
Any help would be greatly appreciated.