📄 conn.bas
字号:
Form1.Text17(6).Text = tempArr(6)
sid = "3" '
tempArr = Split(findData1(sid), "|")
Form1.Text17(7).Text = tempArr(0)
Form1.Text17(8).Text = tempArr(1)
Form1.Text17(9).Text = tempArr(2)
Form1.Text17(10).Text = tempArr(3)
Form1.Text17(11).Text = tempArr(4)
Form1.Text17(12).Text = tempArr(5)
Form1.Text17(13).Text = tempArr(6)
sid = "4" '
tempArr = Split(findData1(sid), "|")
Form1.Text17(14).Text = tempArr(0)
Form1.Text17(15).Text = tempArr(1)
Form1.Text17(16).Text = tempArr(2)
Form1.Text17(17).Text = tempArr(3)
Form1.Text17(18).Text = tempArr(4)
Form1.Text17(19).Text = tempArr(5)
Form1.Text17(20).Text = tempArr(6)
sid = "5" '
tempArr = Split(findData1(sid), "|")
Form1.Text17(21).Text = tempArr(0)
Form1.Text17(22).Text = tempArr(1)
Form1.Text17(23).Text = tempArr(2)
Form1.Text17(24).Text = tempArr(3)
Form1.Text17(25).Text = tempArr(4)
Form1.Text17(26).Text = tempArr(5)
Form1.Text17(27).Text = tempArr(6)
sid = "6" '
tempArr = Split(findData1(sid), "|")
Form1.Text17(28).Text = tempArr(0)
Form1.Text17(29).Text = tempArr(1)
Form1.Text17(30).Text = tempArr(2)
Form1.Text17(31).Text = tempArr(3)
Form1.Text17(32).Text = tempArr(4)
Form1.Text17(33).Text = tempArr(5)
Form1.Text17(34).Text = tempArr(6)
sid = "7" '
tempArr = Split(findData1(sid), "|")
Form1.Text17(35).Text = tempArr(0)
Form1.Text17(36).Text = tempArr(1)
Form1.Text17(37).Text = tempArr(2)
Form1.Text17(38).Text = tempArr(3)
Form1.Text17(39).Text = tempArr(4)
Form1.Text17(40).Text = tempArr(5)
Form1.Text17(41).Text = tempArr(6)
sid = "8" '
tempArr = Split(findData1(sid), "|")
Form1.Text17(42).Text = tempArr(0)
Form1.Text17(43).Text = tempArr(1)
Form1.Text17(44).Text = tempArr(2)
Form1.Text17(45).Text = tempArr(3)
Form1.Text17(46).Text = tempArr(4)
Form1.Text17(47).Text = tempArr(5)
Form1.Text17(48).Text = tempArr(6)
'次丘
sid = "9" '
tempArr = Split(findData1(sid), "|")
Form1.Text18(0).Text = tempArr(0)
Form1.Text18(1).Text = tempArr(1)
Form1.Text18(2).Text = tempArr(2)
Form1.Text18(3).Text = tempArr(3)
Form1.Text18(4).Text = tempArr(4)
Form1.Text18(5).Text = tempArr(5)
Form1.Text18(6).Text = tempArr(6)
sid = "10" '
tempArr = Split(findData1(sid), "|")
Form1.Text18(7).Text = tempArr(0)
Form1.Text18(8).Text = tempArr(1)
Form1.Text18(9).Text = tempArr(2)
Form1.Text18(10).Text = tempArr(3)
Form1.Text18(11).Text = tempArr(4)
Form1.Text18(12).Text = tempArr(5)
Form1.Text18(13).Text = tempArr(6)
sid = "11" '
tempArr = Split(findData1(sid), "|")
Form1.Text18(14).Text = tempArr(0)
Form1.Text18(15).Text = tempArr(1)
Form1.Text18(16).Text = tempArr(2)
Form1.Text18(17).Text = tempArr(3)
Form1.Text18(18).Text = tempArr(4)
Form1.Text18(19).Text = tempArr(5)
Form1.Text18(20).Text = tempArr(6)
'寅寺
sid = "12" '
tempArr = Split(findData1(sid), "|")
Form1.Text19(0).Text = tempArr(0)
Form1.Text19(1).Text = tempArr(1)
Form1.Text19(2).Text = tempArr(2)
Form1.Text19(3).Text = tempArr(3)
Form1.Text19(4).Text = tempArr(4)
Form1.Text19(5).Text = tempArr(5)
Form1.Text19(6).Text = tempArr(6)
sid = "13" '
tempArr = Split(findData1(sid), "|")
Form1.Text19(7).Text = tempArr(0)
Form1.Text19(8).Text = tempArr(1)
Form1.Text19(9).Text = tempArr(2)
Form1.Text19(10).Text = tempArr(3)
Form1.Text19(11).Text = tempArr(4)
Form1.Text19(12).Text = tempArr(5)
Form1.Text19(13).Text = tempArr(6)
sid = "14" '
tempArr = Split(findData1(sid), "|")
Form1.Text19(14).Text = tempArr(0)
Form1.Text19(15).Text = tempArr(1)
Form1.Text19(16).Text = tempArr(2)
Form1.Text19(17).Text = tempArr(3)
Form1.Text19(18).Text = tempArr(4)
Form1.Text19(19).Text = tempArr(5)
Form1.Text19(20).Text = tempArr(6)
sid = "15" '
tempArr = Split(findData1(sid), "|")
Form1.Text19(21).Text = tempArr(0)
Form1.Text19(22).Text = tempArr(1)
Form1.Text19(23).Text = tempArr(2)
Form1.Text19(24).Text = tempArr(3)
Form1.Text19(25).Text = tempArr(4)
Form1.Text19(26).Text = tempArr(5)
Form1.Text19(27).Text = tempArr(6)
sid = "16" '
tempArr = Split(findData1(sid), "|")
Form1.Text19(28).Text = tempArr(0)
Form1.Text19(29).Text = tempArr(1)
Form1.Text19(30).Text = tempArr(2)
Form1.Text19(31).Text = tempArr(3)
Form1.Text19(32).Text = tempArr(4)
Form1.Text19(33).Text = tempArr(5)
Form1.Text19(34).Text = tempArr(6)
sid = "17" '
tempArr = Split(findData1(sid), "|")
Form1.Text19(35).Text = tempArr(0)
Form1.Text19(36).Text = tempArr(1)
Form1.Text19(37).Text = tempArr(2)
Form1.Text19(38).Text = tempArr(3)
Form1.Text19(39).Text = tempArr(4)
Form1.Text19(40).Text = tempArr(5)
Form1.Text19(41).Text = tempArr(6)
sid = "18" '
tempArr = Split(findData1(sid), "|")
Form1.Text19(42).Text = tempArr(0)
Form1.Text19(43).Text = tempArr(1)
Form1.Text19(44).Text = tempArr(2)
Form1.Text19(45).Text = tempArr(3)
Form1.Text19(46).Text = tempArr(4)
Form1.Text19(47).Text = tempArr(5)
Form1.Text19(48).Text = tempArr(6)
'郭楼
sid = "18" '
tempArr = Split(findData1(sid), "|")
Form1.Text20(0).Text = tempArr(0)
Form1.Text20(1).Text = tempArr(1)
Form1.Text20(2).Text = tempArr(2)
Form1.Text20(3).Text = tempArr(3)
Form1.Text20(4).Text = tempArr(4)
Form1.Text20(5).Text = tempArr(5)
Form1.Text20(6).Text = tempArr(6)
sid = "19" '
tempArr = Split(findData1(sid), "|")
Form1.Text20(7).Text = tempArr(0)
Form1.Text20(8).Text = tempArr(1)
Form1.Text20(9).Text = tempArr(2)
Form1.Text20(10).Text = tempArr(3)
Form1.Text20(11).Text = tempArr(4)
Form1.Text20(12).Text = tempArr(5)
Form1.Text20(13).Text = tempArr(6)
sid = "20" '
tempArr = Split(findData1(sid), "|")
Form1.Text20(14).Text = tempArr(0)
Form1.Text20(15).Text = tempArr(1)
Form1.Text20(16).Text = tempArr(2)
Form1.Text20(17).Text = tempArr(3)
Form1.Text20(18).Text = tempArr(4)
Form1.Text20(19).Text = tempArr(5)
Form1.Text20(20).Text = tempArr(6)
sid = "21" '
tempArr = Split(findData1(sid), "|")
Form1.Text20(21).Text = tempArr(0)
Form1.Text20(22).Text = tempArr(1)
Form1.Text20(23).Text = tempArr(2)
Form1.Text20(24).Text = tempArr(3)
Form1.Text20(25).Text = tempArr(4)
Form1.Text20(26).Text = tempArr(5)
Form1.Text20(27).Text = tempArr(6)
'杨店
sid = "22" '
tempArr = Split(findData1(sid), "|")
Form1.Text21(0).Text = tempArr(0)
Form1.Text21(1).Text = tempArr(1)
Form1.Text21(2).Text = tempArr(2)
Form1.Text21(3).Text = tempArr(3)
Form1.Text21(4).Text = tempArr(4)
Form1.Text21(5).Text = tempArr(5)
Form1.Text21(6).Text = tempArr(6)
sid = "23" '
tempArr = Split(findData1(sid), "|")
Form1.Text21(7).Text = tempArr(0)
Form1.Text21(8).Text = tempArr(1)
Form1.Text21(9).Text = tempArr(2)
Form1.Text21(10).Text = tempArr(3)
Form1.Text21(11).Text = tempArr(4)
Form1.Text21(12).Text = tempArr(5)
Form1.Text21(13).Text = tempArr(6)
sid = "24" '
tempArr = Split(findData1(sid), "|")
Form1.Text21(14).Text = tempArr(0)
Form1.Text21(15).Text = tempArr(1)
Form1.Text21(16).Text = tempArr(2)
Form1.Text21(17).Text = tempArr(3)
Form1.Text21(18).Text = tempArr(4)
Form1.Text21(19).Text = tempArr(5)
Form1.Text21(20).Text = tempArr(6)
sid = "25" '
tempArr = Split(findData1(sid), "|")
Form1.Text21(21).Text = tempArr(0)
Form1.Text21(22).Text = tempArr(1)
Form1.Text21(23).Text = tempArr(2)
Form1.Text21(24).Text = tempArr(3)
Form1.Text21(25).Text = tempArr(4)
Form1.Text21(26).Text = tempArr(5)
Form1.Text21(27).Text = tempArr(6)
'军屯
sid = "26" '
tempArr = Split(findData1(sid), "|")
Form1.Text22(0).Text = tempArr(0)
Form1.Text22(1).Text = tempArr(1)
Form1.Text22(2).Text = tempArr(2)
Form1.Text22(3).Text = tempArr(3)
Form1.Text22(4).Text = tempArr(4)
Form1.Text22(5).Text = tempArr(5)
Form1.Text22(6).Text = tempArr(6)
'白石
sid = "27" '
tempArr = Split(findData1(sid), "|")
Form1.Text23(0).Text = tempArr(0)
Form1.Text23(1).Text = tempArr(1)
Form1.Text23(2).Text = tempArr(2)
Form1.Text23(3).Text = tempArr(3)
Form1.Text23(4).Text = tempArr(4)
Form1.Text23(5).Text = tempArr(5)
Form1.Text23(6).Text = tempArr(6)
'南站
sid = "28" '
tempArr = Split(findData1(sid), "|")
Form1.Text24(0).Text = tempArr(0)
Form1.Text24(1).Text = tempArr(1)
Form1.Text24(2).Text = tempArr(2)
Form1.Text24(3).Text = tempArr(3)
Form1.Text24(4).Text = tempArr(4)
Form1.Text24(5).Text = tempArr(5)
Form1.Text24(6).Text = tempArr(6)
sid = "29" '
tempArr = Split(findData1(sid), "|")
Form1.Text24(7).Text = tempArr(0)
Form1.Text24(8).Text = tempArr(1)
Form1.Text24(9).Text = tempArr(2)
Form1.Text24(10).Text = tempArr(3)
Form1.Text24(11).Text = tempArr(4)
Form1.Text24(12).Text = tempArr(5)
Form1.Text24(13).Text = tempArr(6)
sid = "30" '
tempArr = Split(findData1(sid), "|")
Form1.Text24(14).Text = tempArr(0)
Form1.Text24(15).Text = tempArr(1)
Form1.Text24(16).Text = tempArr(2)
Form1.Text24(17).Text = tempArr(3)
Form1.Text24(18).Text = tempArr(4)
Form1.Text24(19).Text = tempArr(5)
Form1.Text24(20).Text = tempArr(6)
sid = "31" '
tempArr = Split(findData1(sid), "|")
Form1.Text24(21).Text = tempArr(0)
Form1.Text24(22).Text = tempArr(1)
Form1.Text24(23).Text = tempArr(2)
Form1.Text24(24).Text = tempArr(3)
Form1.Text24(25).Text = tempArr(4)
Form1.Text24(26).Text = tempArr(5)
Form1.Text24(27).Text = tempArr(6)
'汶上
sid = "48" '
tempArr = Split(findData1(sid), "|")
Form1.Text25(0).Text = tempArr(0)
Form1.Text25(1).Text = tempArr(1)
Form1.Text25(2).Text = tempArr(2)
Form1.Text25(3).Text = tempArr(3)
Form1.Text25(4).Text = tempArr(4)
Form1.Text25(5).Text = tempArr(5)
Form1.Text25(6).Text = tempArr(6)
sid = "49" '
tempArr = Split(findData1(sid), "|")
Form1.Text25(7).Text = tempArr(0)
Form1.Text25(8).Text = tempArr(1)
Form1.Text25(9).Text = tempArr(2)
Form1.Text25(10).Text = tempArr(3)
Form1.Text25(11).Text = tempArr(4)
Form1.Text25(12).Text = tempArr(5)
Form1.Text25(13).Text = tempArr(6)
'苑庄
sid = "34" '
tempArr = Split(findData1(sid), "|")
Form1.Text26(0).Text = tempArr(0)
Form1.Text26(1).Text = tempArr(1)
Form1.Text26(2).Text = tempArr(2)
Form1.Text26(3).Text = tempArr(3)
Form1.Text26(4).Text = tempArr(4)
Form1.Text26(5).Text = tempArr(5)
Form1.Text26(6).Text = tempArr(6)
sid = "35" '
tempArr = Split(findData1(sid), "|")
Form1.Text26(7).Text = tempArr(0)
Form1.Text26(8).Text = tempArr(1)
Form1.Text26(9).Text = tempArr(2)
Form1.Text26(10).Text = tempArr(3)
Form1.Text26(11).Text = tempArr(4)
Form1.Text26(12).Text = tempArr(5)
Form1.Text26(13).Text = tempArr(6)
sid = "36" '
tempArr = Split(findData1(sid), "|")
Form1.Text26(14).Text = tempArr(0)
Form1.Text26(15).Text = tempArr(1)
Form1.Text26(16).Text = tempArr(2)
Form1.Text26(17).Text = tempArr(3)
Form1.Text26(18).Text = tempArr(4)
Form1.Text26(19).Text = tempArr(5)
Form1.Text26(20).Text = tempArr(6)
sid = "37" '
tempArr = Split(findData1(sid), "|")
Form1.Text26(21).Text = tempArr(0)
Form1.Text26(22).Text = tempArr(1)
Form1.Text26(23).Text = tempArr(2)
Form1.Text26(24).Text = tempArr(3)
Form1.Text26(25).Text = tempArr(4)
Form1.Text26(26).Text = tempArr(5)
Form1.Text26(27).Text = tempArr(6)
'义桥
sid = "38" '
tempArr = Split(findData1(sid), "|")
Form1.Text27(0).Text = tempArr(0)
Form1.Text27(1).Text = tempArr(1)
Form1.Text27(2).Text = tempArr(2)
Form1.Text27(3).Text = tempArr(3)
Form1.Text27(4).Text = tempArr(4)
Form1.Text27(5).Text = tempArr(5)
Form1.Text27(6).Text = tempArr(6)
sid = "39" '
tempArr = Split(findData1(sid), "|")
Form1.Text27(7).Text = tempArr(0)
Form1.Text27(8).Text = tempArr(1)
Form1.Text27(9).Text = tempArr(2)
Form1.Text27(10).Text = tempArr(3)
Form1.Text27(11).Text = tempArr(4)
Form1.Text27(12).Text = tempArr(5)
Form1.Text27(13).Text = tempArr(6)
'刘楼
sid = "40" '
tempArr = Split(findData1(sid), "|")
Form1.Text28(0).Text = tempArr(0)
Form1.Text28(1).Text = tempArr(1)
Form1.Text28(2).Text = tempArr(2)
Form1.Text28(3).Text = tempArr(3)
Form1.Text28(4).Text = tempArr(4)
Form1.Text28(5).Text = tempArr(5)
Form1.Text28(6).Text = tempArr(6)
sid = "41" '
tempArr = Split(findData1(sid), "|")
Form1.Text28(7).Text = tempArr(0)
Form1.Text28(8).Text = tempArr(1)
Form1.Text28(9).Text = tempArr(2)
Form1.Text28(10).Text = tempArr(3)
Form1.Text28(11).Text = tempArr(4)
Form1.Text28(12).Text = tempArr(5)
Form1.Text28(13).Text = tempArr(6)
sid = "42" '
tempArr = Split(findData1(sid), "|")
Form1.Text28(14).Text = tempArr(0)
Form1.Text28(15).Text = tempArr(1)
Form1.Text28(16).Text = tempArr(2)
Form1.Text28(17).Text = tempArr(3)
Form1.Text28(18).Text = tempArr(4)
Form1.Text28(19).Text = tempArr(5)
Form1.Text28(20).Text = tempArr(6)
'南旺
sid = "44" '
tempArr = Split(findData1(sid), "|")
Form1.Text29(0).Text = tempArr(0)
Form1.Text29(1).Text = tempArr(1)
Form1.Text29(2).Text = tempArr(2)
Form1.Text29(3).Text = tempArr(3)
Form1.Text29(4).Text = tempArr(4)
Form1.Text29(5).Text = tempArr(5)
Form1.Text29(6).Text = tempArr(6)
'郭仓
sid = "43" '
tempArr = Split(findData1(sid), "|")
Form1.Text30(0).Text = tempArr(0)
Form1.Text30(1).Text = tempArr(1)
Form1.Text30(2).Text = tempArr(2)
Form1.Text30(3).Text = tempArr(3)
Form1.Text30(4).Text = tempArr(4)
Form1.Text30(5).Text = tempArr(5)
Form1.Text30(6).Text = tempArr(6)
Cnn.Close '关闭连接
Set Cnn = Nothing
Exit Sub
getErr:
'writeMsg ("函数getData运行错误 " + Err.Description)
End Sub
Public Sub getINI()
'读取配置文件
Dim fData(4) As String
Dim fDbName As String
Dim fUid As String
Dim fPwd As String
Dim i As Integer
On Error GoTo readErr
Dim oFSO As FileSystemObject
Dim oTextStream As TextStream
Set oFSO = CreateObject("scripting.filesystemobject")
Set oTextStream = oFSO.OpenTextFile(App.Path + "\config.ini", ForReading, False, TristateFalse)
i = 0
Do While i <= 4
fData(i) = oTextStream.ReadLine
i = i + 1
Loop
tInterval = fData(4)
oTextStream.Close
Set oFSO = Nothing
str = "driver={SQL Server};Server=" + fData(0) + ";DATABASE=" + fData(1) + ";UID=" + fData(2) + ";PWD=" + fData(3) '外网数据库:60.211.192.38 uid=sa pwd=thsinfo"
Exit Sub
readErr:
MsgBox "读取配置文件config.ini出错,应用程序终止运行!"
writeMsg ("读取配置文件config.ini出错 " + Err.Description)
End
End Sub
Function writeMsg(ByVal errMsg As String)
'记录出错记录
On Error GoTo writeErr
Dim fsoTest As New FileSystemObject, file1 As File, ts As TextStream
Set file1 = fsoTest.GetFile(App.Path + "\Msg.txt")
If file1.Size > 8000 Then '删除并重建文件,防止文件增长太大(限定为8000字节)
file1.Delete
fsoTest.CreateTextFile (App.Path + "\Msg.txt")
Set file1 = Nothing
Set file1 = fsoTest.GetFile(App.Path + "\Msg.txt")
End If
Set ts = file1.OpenAsTextStream(ForAppending)
ts.WriteLine (CStr(Now) + " " + errMsg)
ts.Close
Exit Function
writeErr:
End Function
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -