|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Dynamic Combobox (description and keyvalue) filled by the databse
'============================================== 'Routine: addDBToComboBox
' Description: Dynamically popup combo box from a database ' Parameters: cmbBox, Key ' Returns: None '============================================== Public Sub addDBToComboBox(ByRef cmbBox As ComboBox, ByRef cn as ADODB.Connection, Byref SQL as string, StoreIndexInTag As Boolean, Optional Id As Variant) On Error GoTo ErrPara dim rs as new ADODB.recordset 'cn is the connection string of the database ' rs.Open cn, SQL do while not rs.eof ' First recordset field should be key field If IsMissing(Id)Then cmbBox.Add rs.fields(1), rs.fields(0) Else mcolCombos.Add rs.fields(1) End If rs.movenext loop rs.close set rs=nothing ExitPara: exit sub ErrPara: Err.Raise Err.Number, Err.Source & "/clsComboHandlers.Add", Err.Description goto ExitPara End Sub ~~~~ If you need help, contact me at binoy_rb@hotmail.com |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Dynamic Combobox (description and keyvalue) filled by the databse |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|
|
|