943,822 Members | Top Members by Rank

Ad:
Apr 3rd, 2008
0

Binding to TDBList

Expand Post »
Does anyone know of a tutorial/site that explains how to bind to a tdblist clearly? If anyone could explain it, I would also appreciate it.

So far I have this and must be missing something. It has been way too long since I have done anything in VB6.

Other than tdbList.ReBind I cannot think of what does it. I have everything bound from the properties side too. I think anyway.

BTW I am linking up to a SQL DB...
Last edited by rrocket; Apr 3rd, 2008 at 6:10 pm.
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
rrocket is offline Offline
58 posts
since Aug 2007
Apr 4th, 2008
0

Re: Binding to TDBList

Hi,

I guess, you want the code for "DataList" box control..:
add a "DataList" control on the form and set these Properties..:

RowSource = ADODC1
ListField ="MyFieldName"
BoundColumn = "MyFieldName"

if you dont have ADODC,
then @ runtime, you can open a recordset and set rowsource to that ADOrecordset

Regards
Veena
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006
Apr 4th, 2008
0

Re: Binding to TDBList

Click to Expand / Collapse  Quote originally posted by QVeen72 ...
Hi,

I guess, you want the code for "DataList" box control..:
add a "DataList" control on the form and set these Properties..:

RowSource = ADODC1
ListField ="MyFieldName"
BoundColumn = "MyFieldName"

if you dont have ADODC,
then @ runtime, you can open a recordset and set rowsource to that ADOrecordset

Regards
Veena
I tried only that and it did not work out for me... Here is what I have so far code wise that should populate the list. Hopefully something will stand out. Currently I am getting the headers, but none of the data.

vb Syntax (Toggle Plain Text)
  1. Public Sub FormOpen(bModal As Boolean, bVisible As Boolean, CurrParentID As String, CurrLocationType As String, Optional fParentform As Form)
  2. 'Set datDirs.Recordset = RunSP("REC", "s_FRCBL", "42330", "Shipper")
  3. sOrder = "Company"
  4. strFilter = "Company" 'sFilter
  5.  
  6.  
  7. Screen.MousePointer = vbHourglass
  8. DataRefresh strFilter, sOrder
  9. Screen.MousePointer = vbDefault
  10.  
  11. StartingPointer = 0
  12. If Not StartingPointer = 0 Then
  13. 'Pointer to Current Selection has been requested
  14. With datDirs.Recordset
  15. If .RecordCount > 0 Then
  16. .MoveFirst
  17. .Find "ID=" & StartingPointer
  18. If Not .EOF Then
  19. TDBCust.Bookmark = .AbsolutePosition
  20. Else
  21. 'If not found in the list specified, look in the un-validated entries
  22. DataRefresh strFilter, sOrder
  23. If Not datDirs.Recordset.EOF Then
  24. datDirs.Recordset.MoveFirst
  25. .Find "ID=" & StartingPointer
  26. 'lstDirs.Bookmark = datDirs.RecordSet.AbsolutePosition
  27. End If
  28. End If
  29. End If
  30. End With
  31. End If
  32.  
  33.  
  34. Me.Show Abs(bModal)
  35. End Sub
  36. Private Sub DataRefresh(CurrFilter As String, CurrOrder As String)
  37. Dim x As Integer
  38. Dim strCurrFilter As String
  39.  
  40. strCurrFilter = UCase(CurrFilter)
  41. Screen.MousePointer = vbHourglass
  42.  
  43. 'Refresh List Message Opens
  44. 'cmdLoading.Visible = True
  45. DoEvents
  46. Me.AutoRedraw = False
  47.  
  48. Set datDirs.Recordset = RunSP("REC", "s_DirectoryListByRole", strCurrFilter, CurrOrder)
  49.  
  50. TDBCust.ReBind
  51.  
  52. DirectoryListFormat sOrder
  53. 'lDirectoryId = TDBCust.Columns("ID")
  54. With datDirs.Recordset
  55. If Not lDirectoryId = 0 Then
  56. .Find "ID=" & lDirectoryId
  57. If .EOF Then
  58. If Not .BOF Then
  59. .MoveFirst
  60. End If
  61. SendKeys "{Home}+{Down}"
  62. Else
  63. TDBCust.Bookmark = .AbsolutePosition
  64. End If
  65. Else
  66. If Not .BOF Then
  67. .MoveFirst
  68. End If
  69.  
  70. End If
  71. End With
  72. DoEvents
  73. Screen.MousePointer = vbDefault
  74. Me.AutoRedraw = True
  75. 'Me.Caption = strCurrFilter & " " & datDirs.Recordset.RecordCount
  76.  
  77. End Sub
Thanks...
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
rrocket is offline Offline
58 posts
since Aug 2007
Apr 5th, 2008
0

Re: Binding to TDBList

Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Timer problems!
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Comments





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC