|
-
Mar 3rd, 2002, 08:19 AM
#1
Thread Starter
Lively Member
How To Populate MS Access Database Into MS Flexgrid ?
Good day !
How can I populate data in an Access database into the Flexgrid ?
I have create a recordset , let say MyRecord, with all the data desired, but how i going to insert all of them into the flexgrid ?
I tried refering to the MSDN explaination but I not really understand.
I wonder how can I do that ?
Thanks a lot !
SonicWave
-
Mar 4th, 2002, 04:04 AM
#2
Hi
You will want something like the following ...
VB Code:
'---- open your recordset first (assuming open and adoRst as recordset variable)
msflex.clear 'meant to clear flex
msflex.cols = 3 ' 3columns
msflex.rows=0 ' clears flex
'---- sets column widths
msflex.colwidth(0)=0
msflex.colwidth(1)=1000
msflex.colwidth(2)=1000
If adoRst.state=adStateOpen then
If Not adoRst.EOF Then
Do Until adoRst.EOF
lngCRow = msflex.rows
msflex.add ""
msflex.textmatrix(lngCRow,0)=adorst("fieldID")
msflex.textmatrix(lngCRow,1)=adorst("Fielddata1")
msflex.textmatrix(lngCRow,2)=adorst("Fielddata2")
adoRst.MoveNext
Loop
End If
adoRst.Close
End If
NOTE: There is no checking on this for whether the recordset value is null, and there should be as it could error on that.
Essentially thats it.
Regards
Vince
Feeling like a fly on the inside of a closed window (Thunk!)
If I post a lot, it is because I am bored at work! ;D Or stuck...
* Anything I post can be only my opinion. Advice etc is up to you to persue...
-
Mar 4th, 2002, 10:43 AM
#3
Thread Starter
Lively Member
Thanks ! I Can Get Your Idea !
Good day !
Thanks a lot for the code !
I got some idea in it already.
I will try to experiemnt with it around and see.
It should be ok for me now 
Thanks again
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|