Databases Reference
In-Depth Information
ListBox_All.RowSource = frm7Bind.ComboBox_Tables.Text
'Using SQL Statement Type
'ListBox_All.RowSourceType = 3
'ListBox_All.RowSource = "SELECT * FROM " &
frm7Bind.ComboBox_Tables.Text
'Using Array
'ConnectString = "DRIVER={Microsoft Access Driver
(*.mdb)};DBQ=" & strDB
'Call GetFieldNames((ConnectString),
frm7Bind.ComboBox_Tables.Text, Fields())
'ListBox_All.RowSourceType = 5
'ListBox_All.RowSource = "Fields"
Looking at Figure 8.7, here the contents of the table named Customers is loaded into the list
box on the left-hand side of the GUI. Because list boxes may not support some “special” characters
that databases may contain (i.e.,
, §, £, etc.), a mechanism must be built in place to handle
errors that will inevitably occur when such characters are encountered and to allow the application
to continue loading data that is in an acceptable format.
When a new table is selected from the combo box, the following things need to happen. Any
existing entries in the list boxes must be removed. The database table to be utilized must be set, a
connection to the database must be made, and the list box must be populated with the chosen
database records. The next subroutine triggers these items to occur.
,
±
,
FIGURE 8.7 Sample application using bound controls to delete database items.
Search WWH ::




Custom Search