Binding to TDBList

Reply

Join Date: Aug 2007
Posts: 58
Reputation: rrocket is an unknown quantity at this point 
Solved Threads: 0
rrocket's Avatar
rrocket rrocket is offline Offline
Junior Poster in Training

Binding to TDBList

 
0
  #1
Apr 3rd, 2008
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.
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 848
Reputation: QVeen72 is on a distinguished road 
Solved Threads: 120
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Practically a Posting Shark

Re: Binding to TDBList

 
0
  #2
Apr 4th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 58
Reputation: rrocket is an unknown quantity at this point 
Solved Threads: 0
rrocket's Avatar
rrocket rrocket is offline Offline
Junior Poster in Training

Re: Binding to TDBList

 
0
  #3
Apr 4th, 2008
Originally Posted by QVeen72 View Post
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.

  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...
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 848
Reputation: QVeen72 is on a distinguished road 
Solved Threads: 120
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Practically a Posting Shark

Re: Binding to TDBList

 
0
  #4
Apr 5th, 2008
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC