admin 管理员组文章数量: 1086019
2024年3月19日发(作者:dreamweaver网页制作图解步步通)
VB代码 连接SQL数据库
Private Sub Command1_Click()
If = True Then
tionString = " Provider=SQLOLEDB.1;Password=" & & ";Persist
Security Info=True;User ID=" & & ";Initial Catalog=" & "KJ70" & ";Data Source=" &
Else
tionString = " Provider=SQLOLEDB.1;Password=" & & ";Persist
Security Info=True;User ID=" & & ";Initial Catalog=" & "KJ70" & ";Data Source=" &
End If
If = adStateOpen Then
If = True Then
Connected_Zhuji = True '主机连接标志
Else
Connected_Zhuji = False '主机连接标志
_GasLoad_d = False
_GasLoad_Place_d = False
End If
d = False
d = True
d = False
d = False
Devece_Name '载入KJ70中的传感器模拟量类型名
If Connected_Zhuji Then
Gas_Load_Place '载入瓦斯涌出量数据库中的瓦斯传感器位置
End If
End If
End Sub
Private Sub Devece_Name()
Dim i As Integer
i = 0
"SELECT DISTINCT 设备名1 From 设备 WHERE (firstFrequencyUp <> 0)", Db,
adOpenForwardOnly, adLockReadOnly
Do While Not
(i) = Rs(0)
i = i + 1
xt
Loop
Set Rs = Nothing
End Sub
Private Sub Command2_Click()
If = adStateClosed Then
Set Db = Nothing
d = True
d = False
d = True
d = True
_d = False
d = False
d = False
d = False
_GasLoad_d = False
End If
End Sub
Private Sub Form_Load()
If = adStateOpen Then
d = False
d = True
d = False
d = False
Else
d = True
d = False
d = True
d = True
End If
End Sub
版权声明:本文标题:[计算机]VB代码连接SQL数据库 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/p/1710854259a576401.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论