R
Ron Pagliuca
I am trying to execute VBScript functions via MSScriptControl in
VB.NET and have the function return a ADODB Recordset. rs3 in the
example below is returned as type __ComObject. I tried using
Marshal.CreateWrapperTypeOf to create a COM wrapper. Anyone have any
ideas how I can I access the recordset back in vb.net, I am able to
get a fields value back from the function. I am interested in using
the RS -- Such As: Dim rs as new ADODB.Recordset = rs3 .
Thanks
Ron
----- Code Snippet ------
Dim sc As New MSScriptControl.ScriptControl()
sc.Language = "VBScript"
sc.AddCode("Function xcv()" & vbCrLf & "SET db =
CreateObject(""ADODB.Connection"")" & vbCrLf &
"db.Open(""PROVIDER=SQLOLEDB;UID=psafe_user;PWD=psafe_user;SERVER=IKE;DATABASE=psafe2;"")"
& vbCrLf & "set rs2 = db.execute(""select * from issue"")" & vbCrLf &
"xcv=rs2" & vbCrLf & "End Function")
Dim ex As String = "xcv"
Dim rs3 As New Object()
rs3 = sc.Eval(ex)
VB.NET and have the function return a ADODB Recordset. rs3 in the
example below is returned as type __ComObject. I tried using
Marshal.CreateWrapperTypeOf to create a COM wrapper. Anyone have any
ideas how I can I access the recordset back in vb.net, I am able to
get a fields value back from the function. I am interested in using
the RS -- Such As: Dim rs as new ADODB.Recordset = rs3 .
Thanks
Ron
----- Code Snippet ------
Dim sc As New MSScriptControl.ScriptControl()
sc.Language = "VBScript"
sc.AddCode("Function xcv()" & vbCrLf & "SET db =
CreateObject(""ADODB.Connection"")" & vbCrLf &
"db.Open(""PROVIDER=SQLOLEDB;UID=psafe_user;PWD=psafe_user;SERVER=IKE;DATABASE=psafe2;"")"
& vbCrLf & "set rs2 = db.execute(""select * from issue"")" & vbCrLf &
"xcv=rs2" & vbCrLf & "End Function")
Dim ex As String = "xcv"
Dim rs3 As New Object()
rs3 = sc.Eval(ex)