Dear All,
I have wrote a function known as "GetRecordset" and I put this function into a VB class and compile it into dll.
The package and class of the dll is "MyData.DataAccess".
The function's signature is shown as below.
Public Function GetRecordset( _
ByVal Connect As String, _
ByVal SQLQuery As String, _
Recordset As ADODB.Recordset) as boolean
Dim oConn As ADODB.Connection
.
.
Set oConn = New ADODB.Connection
Set Recordset = New ADODB.Recordset
Set Recordset.ActiveConnection = oConn
Recordset.CursorLocation = adUseClient
Recordset.CursorType = adOpenStatic
Recordset.LockType = adLockBatchOptimistic
'execute query and get recordset
Recordset.Open SQLQuery, , , , Options
'clean up
Set Recordset.ActiveConnection = Nothing
oConn.Close
Set oConn = Nothing
End fucntion
I have managed to call this fucntion in VB application.
But I can't call it in ASP. I knew that I passed recordset object as reference.
When I called this function in ASP,I get the error "Type Mismatch". For example,
.
.
Set obj = Server.CreateOject("MyData.DataAccess"
Set rs = Server.CreateObject("ADODB.Recordset"
obj.GetRecordset strnn, strsql, rs
.
.
How should call this function or how should pass the recordset object to this function in ASP?
Any one know this, please do help me.
Thank you very much.
Best Regard,
cmlimnet
I have wrote a function known as "GetRecordset" and I put this function into a VB class and compile it into dll.
The package and class of the dll is "MyData.DataAccess".
The function's signature is shown as below.
Public Function GetRecordset( _
ByVal Connect As String, _
ByVal SQLQuery As String, _
Recordset As ADODB.Recordset) as boolean
Dim oConn As ADODB.Connection
.
.
Set oConn = New ADODB.Connection
Set Recordset = New ADODB.Recordset
Set Recordset.ActiveConnection = oConn
Recordset.CursorLocation = adUseClient
Recordset.CursorType = adOpenStatic
Recordset.LockType = adLockBatchOptimistic
'execute query and get recordset
Recordset.Open SQLQuery, , , , Options
'clean up
Set Recordset.ActiveConnection = Nothing
oConn.Close
Set oConn = Nothing
End fucntion
I have managed to call this fucntion in VB application.
But I can't call it in ASP. I knew that I passed recordset object as reference.
When I called this function in ASP,I get the error "Type Mismatch". For example,
.
.
Set obj = Server.CreateOject("MyData.DataAccess"
Set rs = Server.CreateObject("ADODB.Recordset"
obj.GetRecordset strnn, strsql, rs
.
.
How should call this function or how should pass the recordset object to this function in ASP?
Any one know this, please do help me.
Thank you very much.
Best Regard,
cmlimnet