1个回答
展开全部
'Ctrl+t找Microsoft MsChart Control....
'菜单"工程"->"引用" 找 Microsoft ActiveX Data Object....
Dim cn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim SqlStr As String
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db1.mdb;Mode=ReadWrite"
SqlStr = "Select s时间字段,so2,no2 From 某个表"
rst.CursorLocation = adUseClient
rst.Open SqlStr, cn, adOpenDynamic, adLockOptimistic, adCmdText '打开记录集
Set MsChart1.DataSource = rst '给DataGrid修改数据源
'菜单"工程"->"引用" 找 Microsoft ActiveX Data Object....
Dim cn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Dim SqlStr As String
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\db1.mdb;Mode=ReadWrite"
SqlStr = "Select s时间字段,so2,no2 From 某个表"
rst.CursorLocation = adUseClient
rst.Open SqlStr, cn, adOpenDynamic, adLockOptimistic, adCmdText '打开记录集
Set MsChart1.DataSource = rst '给DataGrid修改数据源
追问
连接数据库我是会的。。主要是生成柱状图的问题。。这个我不会
追答
默认就是柱状图啊
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询