|
-
May 1st, 2000, 11:22 PM
#1
Thread Starter
Addicted Member
Hello,
I am having some trouble assigning a recordset returned from a VB dll to as recordset object in ASP. The code below reutrns a type mismatch error:
Microsoft VBScript runtime error '800a000d'
Type mismatch: 'getitems'
/shopping_cart/viewBasket.asp, line 14
Any help would be greatly appreciated.
Thakns in Advance.
Lenin
<%
' Variables
dim cartid
dim records
dim cart1
set cart1 = server.createObject("shopcart.cart1")
cart1.createconnection
cartid = request.cookies("cartid")
'response.write cartid
Set records = Server.CreateObject("ADODB.Recordset")
Set records = cart1.getitems(cartid)
response.write records.recordcount
%>
The function ib VB is:
Public Function getItems(lCartID As Long) As ADODB.Recordset
Dim ls_queryString As String
Dim lrs_getRecords As New ADODB.Recordset
'
' Connect
'
createConnection
ls_queryString = "select widget.widget_id, short_name, price, quantity, price * quantity as Total from cartitem, widget where cart_id = " & lCartID & " and widget.widget_id = cartitem.widget_id"
lrs_getRecords.ActiveConnection = lconn
lrs_getRecords.CursorLocation = adUseClient ' Client Side Cursors
lrs_getRecords.Open ls_queryString, lconn, adOpenStatic, adLockReadOnly
' If lrs_getRecords.RecordCount = 0 Then
' Exit Function
' End If
'
' lrs_getRecords.MoveFirst
'
' Do Until lrs_getRecords.EOF
' MsgBox lrs_getRecords!short_name & " " & lrs_getRecords!total
' lrs_getRecords.MoveNext
' Loop
Set getItems = lrs_getRecords
End Function
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|