ExecSQL Procedure

Function Procedure ExecSQL

Description

Executes the SQL statement.

Remarks

The difference between the Query.Open procedure and the ExecSQL procedure is that ExecSQL does not expect a result. ExecSQL can therefore be very suitable for starting processes.

Example

Sub Main()

Dim SQL

Dim ProdHeadDosCode

Dim Qry

SQL = "Select ProdHeaderDossierCode Proddossier, PartCode Artikel From ProductionHeader"

Set Qry = Application.DataBase.CreateQuery( SQL )

Qry.Open

ProdHeadDosCode = ""

IF Qry.LookUp("For which production file do you want to calculate the structure ","Prod.file") then

ProdHeadDosCode = Qry("Prod.file").Value

End If

Qry.Close

if ProdHeadDosCode > "" Then

SQL = "execute IP_prc_ProdHeadCost "

SQL = SQL + "@ForProdHeaderDossierCode = '" & ProdHeadDosCode & "' "

SQL = SQL + ", @IsahUserCode = '" & Application("IsahUserCode") & "' "

SQL = SQL + ", @ProcessVC = 1 "

SQL = SQL + ", @ProcessNC = 1 "

SQL = SQL + ", @LogPlanGrp = 1 "

SQL = SQL + ", @AllowAddToPlanGrp = 0 "

Qry.SQL = SQL

Qry.ExecSQL

Application.IsahForms.BoxInfo "Structure calculated"

End If

End Sub