Results 1 to 15 of 15

Thread: ok, related tables... ACcESS in VB 6.0 *resolved*

Threaded View

  1. #1

    Thread Starter
    Frenzied Member wpearsall's Avatar
    Join Date
    Feb 2002
    Location
    England / UK
    Posts
    1,065

    Resolved ok, related tables... ACcESS in VB 6.0 *resolved*

    ok, heres the deal...

    i have this code [just the part that im using]

    vb Code:
    1. Option Explicit
    2.  
    3. Private Sub cmdRefresh_Click()
    4. On Error GoTo ErrHand:
    5.  
    6.     Dim sSQL As String
    7.     sSQL = "SELECT BannedMembers.BanDate, BannedMembers.BanReason, Member_Details.MemberID, " & _
    8.            "(Member_Details.Title & ' ' & Member_Details.Surname & ', ' & Member_Details.Forename) AS FullName" & _
    9.            "FROM Member_Details INNER JOIN BannedMembers ON Member_Details.RecordID = BannedMembers.MemberRecID;"
    10.    
    11.     Dim rsBan As New ADODB.Recordset
    12.     rsBan.Open sSQL, ConnOBData, adOpenKeyset, adLockReadOnly
    13.    
    14.     If rsBan.RecordCount > 0 Then
    15.         Dim x As ListItem
    16.         Do Until rsBan.EOF
    17.             Set x = lvBans.ListItems.Add(, , rsBan("MemberID"))
    18.             x.SubItems(1) = rsBan("FullName")
    19.             x.SubItems(2) = rsBan("BanReason")
    20.             x.SubItems(3) = rsBan("BanDate")
    21.  
    22.             rsBan.MoveNext
    23.         Loop
    24.     End If
    25.    
    26.     rsBan.Close
    27.     Set rsBan = Nothing
    28.    
    29. Exit Sub
    30. ErrHand:
    31.     Call LogError
    32. End Sub

    now this basically needs to show the information of the member name, when they are banned til, and why they were banned [so on the discretion of the manager, a ban can be lifted...]

    problem is...

    ---------------------------
    Membership Manager
    ---------------------------
    Error #-2147217887 was generated by Microsoft OLE DB Provider for ODBC Drivers. ODBC driver does not support the requested properties.
    ---------------------------
    OK
    ---------------------------
    now im pretty certain its because of the ado code im using doesnt accept all the access stuff the same way... so someone with a bit of know how help me convert it please? [i could just do a load of vb code i know, but i want this simple as possible lol]

    Code:
    SELECT BannedMembers.BanDate, BannedMembers.BanReason, Member_Details.MemberID, (Member_Details.Title & ' ' & Member_Details.Surname & ', ' & Member_Details.Forename) AS FullName
    FROM Member_Details INNER JOIN BannedMembers ON Member_Details.RecordID = BannedMembers.MemberRecID;
    that works for me when i run it in access,,, so no idea why not in vb... ta
    Last edited by wpearsall; Jul 11th, 2007 at 08:11 PM. Reason: solved
    Wayne

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