我有一个VBScript并尝试从PHP调用VBScript 我试着使用system(),exec()等等。
但注意到VBScript本身工作正常。 我确信我的VBScript是正确的,因为它本身工作正常.. 我不知道为什么当我从php调用它时它不起作用。
我也从php.ini启用了extension = php_com_dotnet.dll .. 有人可以帮帮我吗? 感谢
以下是我的VBScript
Dim cn, rs
set cn = CreateObject("ADODB.Connection")
connectionString = "Driver={MySQL ODBC 5.1 Driver};Server=localhost;Database=testDB;UID=root; Password='root';"
cn.Open connectionString
set rs = CreateObject("ADODB.recordset")
studyid =1
'Sql= "INSERT INTO shrinkage (studyName, anch1, anch2, anch3, node1, node2, distanceB, distanceA) VALUES ('" & studyName &"', '" & anch1 & "' , '" & anch2 & "' , '" & anch3 & "' , '" & node1 & "' , '" & node2 & "' , '" & distanceB & "' , '" & distanceA & "')"
Sql= "SELECT p.studyid, anchor, nodeD, s.study, s.testid FROM parameters p INNER JOIN study s on p.studyid = s.studyid WHERE p.studyid = " & studyid
Set rs = cn.Execute(Sql)
Do While not rs.EOF
studyid = rs(0)
anchor = rs(1)
anchorSet = Split(anchor, " ")
anchor1 = anchorSet(0)
anchor2 = anchorSet(1)
anchor3 = anchorSet(2)
study = rs(3)
runType = rs(4)
' if runType is deflection loop, then we only need one node value
If runType = 1 Then
node = rs(2)
' if runType is shrinkage loop, then we need two node values.
ElseIf runType = 2 Then
node = rs(2)
nodeSet = Split(node, " ")
node1 = nodeSet(0)
node2 = nodeSet(1)
End If
rs.MoveNext
Loop
cn.close
MsgBox "End of program"