datagrid 行使用无效
为什么报行使用无效呢?Private Sub Form_Load()
Adodc1.ConnectionString = Conn
SqlStmt = "select zongfen.order1 as 排名,zongfen.xueshnum as 学号, xuesheng.xueshnam as 姓名,zongfen.ss as 总分 from zongfen ,xuesheng where zongfen.xueshnum=xuesheng.xueshnum order by ss desc"
Adodc1.CommandType = adCmdText
Adodc1.RecordSource = SqlStmt
Adodc1.Refresh
Dim i As Integer
For i = 0 To Adodc1.Recordset.RecordCount
DataGrid1.Row = i
DataGrid1.Columns(0).Text = i + 1
Next i
End Sub --------------------编程问答-------------------- order by ss 是咋回事,哪来的ss,属于哪个表? --------------------编程问答-------------------- DataGrid 是不这样用的,直接绑定即可。
如果你习惯这样的用法,可将 DataGrid 换为 HFlexGrid。
补充:VB , 数据库(包含打印,安装,报表)