Results 1 to 2 of 2

Thread: listview with ado

  1. #1

    Thread Starter
    Member
    Join Date
    Mar 1999
    Location
    San Diego, Ca , USA
    Posts
    44

    Post

    Hello,
    Can some one help me here. I am trying to put my database that comes from 2 tables inside listview. i am using ado connection. At line "itmX.ListSubItems(1) = CStr
    (adoRS!t2_field3)", the compiler is telling me "Invalid property value, run time error 380"
    here is my code What am i doing wrong? Any hint is appreciated. Thanks in advance.
    private sub loadform
    Dim sql As String
    Dim itmX As ListItem

    Set adoRS = New ADODB.Recordset
    sql = "SELECT t1_field1, t2_field3"
    sql = sql & " FROM t1, t2" sql = sql & " WHERE t1.field2= t2.field2
    adoRS.Open sql, db, adOpenStatic, adLockOptimistic

    If adoRS.RecordCount > 0 Then
    While Not adoRS.EOF
    Set itmX = ListView1.ListItems. _
    Add(, , CStr(adoRS!t1_field1))
    If Not IsNull(adoRS!t2_field3) Then
    itmX.ListSubItems(1) = CStr
    (adoRS!t2_field3)
    end if
    adoRS.MoveNext ' Move to next record.
    Wend
    End If
    end sub

  2. #2
    New Member
    Join Date
    Jun 1999
    Location
    boston
    Posts
    2

    Post

    Do not use listsubItems collections, Try use
    subItems collection in vb 6.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width