Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Assign ado datafieldsto dataGrid cols & populate
Message
De
05/10/2004 15:33:24
 
 
À
Tous
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Titre:
Assign ado datafieldsto dataGrid cols & populate
Divers
Thread ID:
00948901
Message ID:
00948901
Vues:
57
Hello everyone
I am attempting to assign data fields from access 2003 to a dataGrid in VB6. I do not want to use the the properties wizard to assign the data, I want to do it using code. This is what I have, but the dataGrid displays blank. Col headings do display as specified. The record set is defined as such:

With rstCatPrimary
.ActiveConnection = conMMM
.CursorLocation = adUseClient
.Source = "select id, primaryCode, desc from CatPrimary"
.LockType = adLockOptimistic
.Open
.MoveFirst 'move the rec pointer to the top of the data set
End With

With grdData
.
.
'Col Headers *******
.Columns(0).Caption = "Primary Key"
.Columns(1).Caption = "Primary Description"
'Col data assignments ****** (NEXT 2 LINES IS THE PROBLEM)
.Columns(0).DataField = rstCatPrimary!primarycode
.Columns(1).DataField = rstCatPrimary!Desc
End With

The grid does populate if I use the properties wizard, so the dataset is solid

Thanks in advance
Répondre
Fil
Voir

Click here to load this message in the networking platform