Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Assign ado datafieldsto dataGrid cols & populate
Message
From
05/10/2004 15:33:24
 
 
To
All
General information
Forum:
Visual Basic
Category:
Database DAO/RDO/ODBC/ADO
Title:
Assign ado datafieldsto dataGrid cols & populate
Miscellaneous
Thread ID:
00948901
Message ID:
00948901
Views:
56
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
Reply
Map
View

Click here to load this message in the networking platform