|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
ASP: Type Mismatch
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 |
|
#2
|
||||
|
||||
|
i think that it is assuming the recordset is not a recordset, rather...it thinks that it is a string maybe. you might try to just pass the sql for the recordset, then open the recordset in the current function, rather than just passing the recordset itself.
|
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > ASP: Type Mismatch |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|