I have the following code to create a record into 2 tables in my SQL
database.  The 2 tables are WorkRequest where WRID is the KEY/Unique
Identifier and File_details where FileID is the KEY/Unique Identifier but
has WRID as a KEY for linking to the Work Request table.

When I run this code, it will create the records with no problem.  However,
when I try to update the table in MS Access manually I get a WRITE CONFLICT
error.   It is acting like the database connection to that record is still
open. However, I can update it with an UPDATE QUERY with no problems.

I have tried rearranging the $db1->Close(); statements a hundred ways and
nothing seems to work.

Anyone have any ideas?  I have put the code below.
Thanks,
Kristi

$db1 = new Win32::ODBC("DSN=dmcprod;UID=nDMC45;PWD=nDMC65;");


$db1->Sql("INSERT INTO WorkRequest(DCA, Billing_Status, Create_Date, AccRep,
CC, BU_Group, ClientID, Customer_Name, ProjectID, WRType, IntorData,
ShipDate, Ext)  VALUES('NONE' , 'NONE', '$lstamp', 'person', 'people',
'SERVICES', '000', 'customer', 'XXXX ', 'Outbound', 'Dataset', '$sstamp',
'20000')");


$db1->Sql("SELECT [EMAIL PROTECTED]@IDENTITY AS 'Identity'" );
$db1->FetchRow();
%db1hash = $db1->DataHash();
$wrnum = $db1hash{'Identity'};

$db1->Sql("INSERT INTO File_Details(WRID, FileName, MediaType,
Conversion_Type, PCOMMENTS, Output_Filename, Record_Count, Record_Length,
Additional_Info, Status) VALUES('$wrnum', 'SEE ADDITIONAL INFORMATION ',
'CDROM', 'LOAD FILE AS IS', 'Auto Create WR for CD', 'SAME', '0', '0',
'information' , 'CREATED' )");

$db1->Close();


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to