Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_components thread: RES: Microsoft VBScript runtime (0x800A000D) Type Mismatch


Message #1 by =?iso-8859-1?Q?Fl=E1vio_Rodrigues_Maciel?= <flaviorm@p...> on Mon, 16 Sep 2002 20:33:50 -0300
try
Set Catalog = Visit.Catalog
Set Children = Catalog.GetChildCategories(Category("CategoryID"))


-----Mensagem original-----
De: Shalon Huff [mailto:shalonhuff@h...]
Enviada em: terça-feira, 17 de setembro de 2002 00:30
Para: ASP components
Assunto: [asp_components] Microsoft VBScript runtime (0x800A000D) Type
Mismatch


Help please!

I'm having a problem with this line of code

  Set Children = Visit.Catalog.GetChildCategories(Category("CategoryID"))
I've looked at my Catalog object and RunQuery method but can't seem to
find an error

-->Catalog Object
  Option Explicit

Private m_utility As IUtility
Public Sub Configure(ByVal utility As IUtility)
  Set m_utility = utility

End Sub

Public Function AddCategory(ByVal Name As String, _
                Optional ByVal ParentID As Long) As Long

Dim NewCategory As New Recordset
NewCategory.Open "tblCategory_Shalon", m_utility.DB.DB, adOpenKeyset, _
                adLockOptimistic

NewCategory.AddNew
NewCategory("CategoryName") = Name

If ParentID <> 0 Then NewCategory("CategoryIDP") = ParentID

NewCategory.Update
AddCategory = NewCategory("CategoryID")

NewCategory.Close
Set NewCategory = Nothing

End Function

Private Function QueryCategories(Optional ByVal Where As String, _
                    Optional ByVal Order As String = "CategoryName", _
                    Optional ByVal AsKeyset As Boolean = False) _
                    As Recordset

Set QueryCategories = m_utility.DB.RunQuery("tblCategory_Shalon", , _
                                        Where, Order, AsKeyset)
End Function


Public Function GetCategories(Optional ByVal AsKeyset As Boolean = False) _
                As Recordset
    Set GetCategories = QueryCategories("CategoryIDP is null", , AsKeyset)

End Function

Public Function GetAllCategories(Optional ByVal AsKeyset As Boolean 
False) _
                                    As Recordset
    Set GetAllCategories = QueryCategories(, , AsKeyset)

End Function

Public Function GetCategory(ByVal CategoryID As Long, _
                                Optional ByVal AsKeyset As Boolean 
False) _
                                As Recordset
Set GetCategory = QueryCategories("CategoryID=" & CategoryID, , _
                                            AsKeyset)

End Function


Public Function GetChildCategories(ByVal CategoryID As Long, _
                            Optional ByVal AsKeyset As Boolean = False) _
                            As Recordset

 Dim Where As String
 Where = "CategoryIDP=" & CategoryID

Set GetChildCategories = QueryCategories("CategoryIDP=" & CategoryID, , _
                                                AsKeyset)


End Function

'RunQuery - runs the query
Public Function RunQuery(ByVal TableName As String, _
                Optional ByVal ViewName As String, _
                Optional ByVal Where As String, _
                Optional ByVal Order As String, _
                Optional ByVal AsKeyset As Boolean = False, _
                Optional ByVal UseTable As Boolean = False) _
                As Recordset

Dim sql As String

sql = "select * from "
If ViewName = "" Or UseTable = True Then
    sql = sql & TableName
Else
    sql = sql & ViewName
End If

If Where <> "" Then sql = sql & " where " & Where

If Order <> "" Then sql = sql & " order by " & Order

If AsKeyset = False Then
    Set RunQuery = DB.Execute(sql)
Else
    Set RunQuery = New Recordset
    RunQuery.Open sql, DB, adOpenKeyset, adLockOptimistic
End If

End Function

Sorry for the long post.  Thanks in advance for your help!

Shalon
shalonhuff@h...

%%email.unsub%%


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.386 / Virus Database: 218 - Release Date: 9/9/2002


  Return to Index