Basic data access example - IM Payroll integration

This is a working snippet from an Integration Manager Payroll integration. I'm posting it mainly as an example of data access, but it also shows how to access fields in a Payroll integration
'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

RealWorldCode gives developers practical, real‑world solutions with clean, working code — no fluff, no theory, just answers.
Links
Home
Knowledge Areas
Sitemap
Contact
Et cetera
Privacy Policy
Terms and Conditions
Cookie Preferences