?? modcon.bas
字號:
Attribute VB_Name = "Modcon"
Global cn As ADODB.Connection
Public computername As String '用于存儲(chǔ)得到的計(jì)算機(jī)名字
Option Explicit
Public Declare Function GetTickCount Lib "kernel32" () As Long
Global m_id As Single '定義個(gè)編號,也就是是那個(gè)貓收到的數(shù)據(jù)進(jìn)行處理
Public Sub MakeConnection()
On Error GoTo err_exit
Dim ipadd$
Open App.Path + "\ip.txt" For Input As #1
Input #1, ipadd
Close #1
Set cn = New ADODB.Connection
With cn
.ConnectionString = "Driver=SQL Server;Server=" + ipadd + ";DataBase=saige;uid=sa;pwd=sa;"
.Open
End With
Exit Sub
err_exit:
MsgBox ("數(shù)據(jù)庫連接錯(cuò)誤,請確認(rèn)主機(jī)的ip地址!")
End
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -