Basic data access example

This is a basic example of what data access code looks like in a script in Integration Manager.

We demonstrate the usage of the GPConnection object, Stored Procedures, and Parameters

'Create a new connection
Set oConn = CreateObject("ADODB.Connection")
'Open the connection to the database
oConn.Connectionstring = "database=" + GPConnection.GPConnInterCompanyID
GPConnection.Open(oConn)
set oCMD = CreateObject("ADODB.Command")
 
oCMD.ActiveConnection = oConn
oCMD.CommandText = "dd_CM20400_addDistRef"
oCMD.CommandType = 4
 
set strCheckbook = SourceFields("MiscChecksLNE_RCL1.Checkbook")
set strTrxNum = SourceFields("MiscChecksLNE_RCL1.Check#")
set strDistRef = SourceFields("MiscChecksLNE_RCL1.Distribution Reference")
 
adVarChar = 200
adParamInput = 1
oCMD.Parameters.Append oCMD.CreateParameter("@CHEKBKID", adVarChar, adParamInput, 15,strCheckbook  )
oCMD.Parameters.Append oCMD.CreateParameter("@cmtrxnum", adVarChar, adParamInput, 21, strTrxNum )
oCMD.Parameters.Append oCMD.CreateParameter("@distref", adVarChar, adParamInput, 31, strDistRef )
 
'Execute the stored procedure
oCMD.Execute
 
'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