窗体中有Command和MSHFlexGrid两控件: Public cn As New ADODB.ConnectionPrivate Sub Command1_Click() Set DataReport1.DataSource = MSHFlexGrid1.DataSource DataReport1.Show End SubPrivate Sub Form_Load() Dim rs As New ADODB.Recordset cn.Open "provider=sqloledb.1;password=密码;user id=sa;initial catalog=数据库名;data source=服务器名" rs.Open "select * from T_Sell", cn, 1, 1 Set MSHFlexGrid1.DataSource = rs End Sub
用printer对象打印其实将记录集生成html文件,放在webbrowser中打印预岚比较不错你可以试试
我的email是[email protected]
EM:[email protected]
[email protected]
[email protected]
请你喝酒 撒
[email protected]
谢谢
[email protected]
谢谢
[email protected]
[email protected]
[email protected]
[email protected]
谢啦
Public cn As New ADODB.ConnectionPrivate Sub Command1_Click()
Set DataReport1.DataSource = MSHFlexGrid1.DataSource
DataReport1.Show
End SubPrivate Sub Form_Load()
Dim rs As New ADODB.Recordset
cn.Open "provider=sqloledb.1;password=密码;user id=sa;initial catalog=数据库名;data source=服务器名"
rs.Open "select * from T_Sell", cn, 1, 1
Set MSHFlexGrid1.DataSource = rs
End Sub
谢谢大大了!!!
谢谢