Option Explicit
Public pubcn As New ADODB.Connection
Dim temp_i As Integer
''连接数据库
Public Sub GetConnect()
On Error GoTo errorhandler:
Dim constr As String
If Not (pubcn.State = 0) Then
pubcn.Close
End If
pubcn.CursorLocation = adUseClient
pubcn.ConnectionTimeout = 5
pubcn.Open "Provider=sqloledb;" & _
"Network Library=DBMSSOCN;" & _'指明采用IP+端口方式查找Sql Server
"Data Source=172.17.21.125,1433;" & _
"Initial Catalog=hpdata;" & _
"User ID=user;" & _
"Password=password;" & _
"Encrypt=yes"
pubcn.DefaultDatabase = "hpdata" ''!!!!!!!!!!
一个离线ADO数据管理模块的实现
最新推荐文章于 2024-06-20 14:41:29 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)