Compile function Copy_TW_CODES_Record_To_SQL(Connection, Key, Record)

/*****************************************************************************\
	Copies the given TW_CODES record to the MSSQL database.
	
	History
	-------
	06/29/2010    KRF   Original Programmer
\*****************************************************************************/

Declare function SQL_Write, SQL_Format
Ans = ""

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

// List of data fields and their values
DataFields  = "[DESC]"           :@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"):@FM
DataFields := "NON_PROD"         :@VM:SQL_Format(Rec(4), "BIT"):@FM
DataFields := "RUN_DATA_REQUIRED":@VM:SQL_Format(Rec(5), "BIT")

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

Return Ans
