|
-
Jun 25th, 2007, 10:51 AM
#1
Thread Starter
Frenzied Member
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:
Option Explicit
Private Sub cmdRefresh_Click()
On Error GoTo ErrHand:
Dim sSQL As String
sSQL = "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;"
Dim rsBan As New ADODB.Recordset
rsBan.Open sSQL, ConnOBData, adOpenKeyset, adLockReadOnly
If rsBan.RecordCount > 0 Then
Dim x As ListItem
Do Until rsBan.EOF
Set x = lvBans.ListItems.Add(, , rsBan("MemberID"))
x.SubItems(1) = rsBan("FullName")
x.SubItems(2) = rsBan("BanReason")
x.SubItems(3) = rsBan("BanDate")
rsBan.MoveNext
Loop
End If
rsBan.Close
Set rsBan = Nothing
Exit Sub
ErrHand:
Call LogError
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|