Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Combo Format problem
Message
 
À
10/01/2002 04:13:07
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00590977
Message ID:
00602913
Vues:
26
I never used those files but the only thing that needs to be changed in my sample is the mkCS constant to fit your data provider.


>Hi,
>
>Thank for your help on the advise below to display all the data
>on my combo box but my database file is using Visual Fox free table,
>which is the dbf extension, not the Jet Engine which is using the
>access table. Is there any way that I can achieve this using the
>Visual fox free table. The default way to additem is very slow
>plus there is a limitation to the combobox on the data size.
>Please kindly advise. Thank you
>
>>>>>Hi,
>>>>>
>>>>>Thank for your help and advise.
>>>>>BTW, how do I go about using a fixed font in my combobox problem
>>>>>since it is due to the font problem ? Which font is a fixed fonts ?
>>>>>
>>>>
>>>>Courrier
>>>
>>>Hi,
>>>
>>>As mentioned previously, if I want to programmtically
>>>bind an ADO recordset to a auto filled combo, I should be using
>>>data combo control.
>>>
>>>However, it don't seem to auto fill up the combo box with my
>>>data at all. I am using code insteads of the ADO control with part of
>>>my code shown below, please kindly advise and comment.
>>>
>>>
>>> Set cnn = New ADODB.Connection
>>> Set rs = New ADODB.Recordset
>>>
>>> ...
>>> ...
>>>
>>> cboDataCombo.ListField = "Vip"
>>> set cboDataCombo.RowSource = rs
>>
>>
>>Set the RowSource property before the ListField property like this:
>>
Private Const mkCS As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Projets VB\NWIND.MDB;"
>>
>>Private Sub Command1_Click()
>>Dim rstData As ADODB.Recordset
>>
>>    Set rstData = New ADODB.Recordset
>>    rstData.Open "SELECT LastName FROM Employees", mkCS, adOpenStatic, adLockReadOnly
>>    Set DataCombo2.RowSource = rstData
>>    DataCombo2.ListField = "LastName"
>>End Sub
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform