office2016删除打印机:求助VB高手

来源:百度文库 编辑:高校问答 时间:2024/05/07 03:47:50
这是一个模拟的数据采集系统,里面有一个数据库,是用来代替采集环境的,就是通过
OBDC把通过这个模拟数据库采集到的数据,存储到一个新的数据库中就可以了
现在的这个系统就是没有存到新数据库的功能
用户和密码为:0
Private Sub Command1_Click()
Label8.Visible = True
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\JIANKONG.mdb;Persist Security Info=False"
'定义你的SQL语句
tmp_sql = "select * from JIANKONG where ID=1"
'执行你的SQL语句
rs.Open tmp_sql, conn
If rs.Fields("light") = 0 Then
Image1(0).Picture = ImageG(1).Picture
Else
Image1(0).Picture = ImageR(1).Picture
End If
rs.Close
'关闭数据库连接
conn.Close
'清除内存
Set rs = Nothing
Set conn = Nothing
End Sub

Private Sub Command10_Click()
Form1.Show
Main.Visible = False
End Sub
Private Sub Command11_Click()
Label13.Visible = True
Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\JIANKONG.mdb;Persist Security Info=False"
'定义你的SQL语句
tmp_sql = "select * from JIANKONG where ID=2"
'执行你的SQL语句
rs.Open tmp_sql, conn
If rs.Fields("light") = 0 Then
Image1(5).Picture = ImageG(1).Picture
Else
Image1(5).Picture = ImageR(1).Picture
End If
rs.Close
'关闭数据库连接
conn.Close
'清除内存
Set rs = Nothing
Set conn = Nothing
End Sub
Private Sub Command12_Click()
Form1.Show
Main.Visible = False
End Sub

程序出错