DataGrid 的记录值显示问题!!!高手救我,小弟先拜谢了!!!
大虾们:
小弟是个新手,最近在搞一个VB+SQLServer的图书管理系统。其中有一个界面是显示图书订购信息的,我原先使用MSFlexGrid显示的记录,
先是在界面的load 时
Set myRecordset = New ADODB.Recordset
myRecordset.Open "select * from orderBook", adoConn, adOpenDynamic
Call ShowTitle
Call ShowData
其中ShowData的函数是这样的:
Private Sub ShowData()
Dim i As Integer
Dim j As Integer
Dim curentRow As Integer
curentRow = 0
Do While Not myRecordset.EOF
curentRow = curentRow + 1
For i = 1 To myRecordset.Fields.Count
MSFlexGridOrderBook.TextMatrix(curentRow, i) = myRecordset.Fields(i - 1)
Next i
myRecordset.MoveNext
Loop
myRecordset.Close
End Sub
这样的记录是可以显示出来的。后来我想改用dataGrid 来显示数据,但怎么也不知道把记录写入的方法,就是象上面
MSFlexGridOrderBook.TextMatrix(curentRow, i) = myRecordset.Fields(i - 1)
这一句的功能,在DataGrid的方法或者属性里面有这样的功能吗?