Compile function Copy_LOSS_CODES_Record_To_SQL(Connection, Key, Record)

/*****************************************************************************\
	Copies the given LOSS_CODES record to the MSSQL database.
	
	History
	-------
	04/22/2010    KRF   Original Programmer
\*****************************************************************************/

Declare function SQL_Write, SQL_Format
Ans = ""

// Parse record into a dimensioned array for speed
Dim Rec(4)
MatParse Record into Rec
					    
// List of key names and their values
Keys = "CODE":@VM:SQL_Format(Key, "STR")

// List of data fields and their values
DataFields  = "DESCRIPTION":@VM:SQL_Format(Rec(1), "STR"):@FM
DataFields := "ENTRY_ID"   :@VM:SQL_Format(Rec(2), "STR"):@FM
DataFields := "ENTRY_DATE" :@VM:SQL_Format(Rec(3), "DATE")

// Write the data to the SQL database
Ans = SQL_Write(Connection, "LOSS_CODES", Keys, DataFields);

Return Ans
