0
我無法理解VBA功能。代碼片段和我的問題如下:理解VBA片斷的麻煩;更改代碼以僅允許來自一個輸入的多個輸入
Sub PullItem()
Dim PurchOrder As CimObjectVariable
--What does this next line do? The customer is using CIMPLICITY graphics
Set PurchOrder = CimGetScriptOwner().GetVariable("PurchOrder")
' SQL Connection String
Set oADOConn = CreateObject("ADODB.Connection")
Set oADORecords = CreateObject("ADODB.RecordSet")
oADOConn.ConnectionString = PointGet("SQL.INST") & PointGet("SQL.connStr")
oADOConn.Open
'If the connection failed to open, we exit the script
If oADOConn.State <> 1 Then
LogStatus IT_FAILURE,"","Failed to Connect to SQL Server"
End
End If
--This is all done on a single screen
--There's a block of 30 purchase orders
--As it is you can select all of them or only one of them
--Supposedly that's what this next block of code is doing
--What I need this code to do is allow the customer to select
--between 1 and 10 purchase orders
--So can you explain what is happening here and how I can accomplish
--what I need?
If PurchOrder = "AllPOs" Then
pOrder = "%"
Else pOrder = ProdOrder
End If
SQLQuery = "EXEC [dbo].[GetPO] @PurchOrder = '" & pOrder & "'"
oADORecords.Open SQLQuery, oADOConn
其餘的代碼只是操縱變量。這也需要一些工作,但一次一步。
我對'CIMPLICITY'完全不熟悉,但看起來您需要在那裏配置用戶界面。看起來有文件[這裏](http://proscada.ru/cimplicity/)。 – Comintern