'Create a new connection
Set oConn = CreateObject("ADODB.Connection")
'Open the connection to the database
oConn.Connectionstring = "Provider=SQLNCLI11;Server=gpserver\gpserver;Database=RMEC;User ID=IntegrationManagerUser;Password=John3:16"
GPConnection.Open(oConn)
set oCMD = CreateObject("ADODB.Command")
oCMD.ActiveConnection = oConn
oCMD.CommandText = "dd_UPR00100_SEL_forIntegration"
oCMD.CommandType = 4
set oRS = createObject("ADODB.Recordset")
set strEmployID = SourceFields("TimeClockExport.Employee id")
set strPayCode = SourceFields("TimeClockExport.Transaction Code")
adVarChar = 200
adParamInput = 1
oCMD.Parameters.Append oCMD.CreateParameter("@EMPLOYID", adVarChar, adParamInput, 15,strEmployID )
oCMD.Parameters.Append oCMD.CreateParameter("@PAYCODE", adVarChar, adParamInput, 11, strPayCode )
'Execute the stored procedure
set oRS = oCMD.Execute
IF NOT oRS.eof then
set strStateCode = oRS("StateCode")
set strSutaTax = oRS("SutaTax")
set strWorkersComp = oRS("WorkersComp")
DestinationFields("Entries.State Code") = cstr(strStateCode )
DestinationFields("Entries.Suta State") = cstr(strSutaTax )
DestinationFields("Entries.Workers Comp") = cstr(strWorkersComp )
end if
'Close the connection
Call oConn.Close