VB调用eval出错,如何解决?
Public Function Constant(Tag)
Dim ClassGlobal As Globals
Dim MSSC
Set ClassGlobal = New Globals
Set MSSC = Server.CreateObject("MSScriptControl.ScriptControl")
Constant = MSSC.Eval("ClassGlobal." & Tag)
End Function
VB里调用eval提示出错:
ScriptControl 错误 '80004005'
The operation could not be completed because the script engine has not been initialized to a valid language.
[解决办法]
Server是什么?
[解决办法]
Public Function Constant(Tag)
Dim ClassGlobal As Globals
Dim MSSC
Set ClassGlobal = New Globals
Set MSSC = Server.CreateObject("MSScriptControl.ScriptControl")
MSSC.Language = "VBScript" ' 试试这样行不行?
Constant = MSSC.Eval("ClassGlobal." & Tag)
End Function