borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Find unique values)Next Topic (sql statement) New Topic New Poll Post Reply
AndreaVB Forum : Database : ADO record retrieval multi columns
Poster Message
madhat
Level: Guest


icon ADO record retrieval multi columns

Can anyone help?

I am trying to retrieve records from various dates within a database using ADO and trying to populate multi fields/columns. Here's an example:

format for Database:
DATE    FIELD1  FIELD2
111502  12345   6789
111602  34567   897
111702  56789   0988

fields on my form:

Column1      Column2       Column3
--------     -------       -------
DATE          DATE          DATE
FIELD1        FIELD1        FIELD1
FIELD2        FIELD2        FIELD2

(it would look like this):
111502        111602        111702
12345         34567         56789
6789          897           0988

I don't neccessarily need to use ADO if you have a better way. I do not want a data bound field either.

Thanks for any help!







    

16-11-2002 at 07:30 PM
| Quote Reply
noycez
Level: VB Guru


Registered: 14-10-2002
Posts: 79
icon Re: ADO record retrieval multi columns

Assume that we put a FlexGrid in Form, name msList and a recordset with your values in table
**********************************************
msList.Rows = 4 '# of fields + 1
msList.Cols = rec.RecordCount + 1
rec.MoveFirst

Do While Not rec.EOF
    msList.TextMatrix(1, rec.Bookmark) = rec!Date
    msList.TextMatrix(2, rec.Bookmark) = rec!Field1
    msList.TextMatrix(3, rec.Bookmark) = rec!Field2
    rec.MoveNext
Loop
***********************************************



____________________________
Funny thought:

Practice makes perfect.....
But nobody's perfect......
so why practice?

19-11-2002 at 12:21 AM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : ADO record retrieval multi columns
Previous Topic (Find unique values)Next Topic (sql statement) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder