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


本文标签: 传感器 数据库 连接 网页 制作