
I'm creating an integration that needs to call a SQL Stored Procedure in the After Document script. The VB Script passes 4 variables to the Stored Proc so that it can take those values and go off and do something else. A couple of the parameters are dates, the others are strings.
I've gotten it to 'work', but there has got to be a more elegant way to do this. How would you script this?
Kind regards,
Leslie
*This post is locked for comments
I have the same question (0)Hi Leslie,
I'd use something like the following:
Set oCon = CreateObject("ADODB.Connection")
'open the connection
oCon.Open GetVariable("sDSN")
strSQL = "EXEC " & GPConnection.GPConnIntercompanyID & "..INSERT_IG_IM_SPROC " & _
"'" & SourceFields("GL Trans Header.DocNum") & _
"', '" & SourceFields("GL Trans Header.Date") & _
"', '" & SourceFields("GL Trans Header.Reference") & _
"', '" & SourceFields("GL Line Detail.Amount") & "'"
'Execute the statement
oCon.Execute strSQL