Problem calling Com+ from asp...

H

Hagge

Hi,
I'm turning my application into a "DLL".
Everything worked fine untill I try to do a "While" in my asp code.
Then I recieve an error like this:
"Object variable or With block variable not set"

Please help me. I'm rather new to com programming

My vb code look like this.


Option Explicit

Public sArticleID As String
Public sArticleDesc As String
Public iUnitPrice As Integer
Public iQuantity As Integer
Public sAdded As String
Public sLoginGUID As String
Public bUserActive As String
Public iStock As Integer
Public sFromTable As String
Public oldArtID As String

Private dbConn As ADODB.Connection
Private rs As ADODB.Recordset
Private SQL As String
Private rowStatus As Boolean

Private Sub Class_Initialize()

rowStatus = False

End Sub

Private Property Get db()
If dbConn Is Nothing Then
Set dbConn = New Connection
dbConn.ConnectionString = constConnectionString
dbConn.Open
End If

Set db = dbConn
End Property

Public Property Let dataConn(str)
constConnectionString = str
End Property

Public Function getItems(ByVal strCustomerNo As String, ByVal strPriceGroup
As String, ByVal strSite As String) As Boolean

' If rowStatus is False then the query was not run before.
If rowStatus = False Then
If strPriceGroup <> "" Then
' Do nothing
Else
SQL = ""
SQL = SQL & "EXEC sp_getBasket "
SQL = SQL & "@sSite='" & strSite & "',"
SQL = SQL & "@sCustomerNo='" & strCustomerNo & "',"
SQL = SQL & "@sPriceGroup='" & strPriceGroup & "'"
Set rs = db.Execute(SQL)
rowStatus = True

End If
Else
rs.MoveNext
End If

If rs.EOF Then
rs.Close
rowStatus = False
getItems = False
Exit Function
End If

sArticleID = rs("sArticleID")
sArticleDesc = IfNull(rs("sArticleDesc"), "")
iUnitPrice = rs("iUnitPrice")
iQuantity = rs("iQuantity")
sAdded = rs("sAdded")
sLoginGUID = rs("sLoginGUID")
bUserActive = rs("bUserActive")
iStock = rs("iStock")
sFromTable = rs("sFromTable")

getItems = True

End Function
 
H

Hagge

I found the error, after 2 hours.
I wrote If strPriceGroup <> "" Then should be =

Sorry!
// Hagge
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top