程序如下:
在程序的LOAD事件中,用ADO 连接到了本机(机器名就是cf),在局域网络通的情况下运行该程序,
点击运行Command1_Click()正常,把网络线拔掉,再执行点击运行Command1_Click(),会出现下面的
提示:
[DBNETLIB][ConnectionWrite (send()).]General network
error.Check your network documentation. 也就是说:当把网络线拔掉竟然会断开连接本机的sqlserver??但假如网络本来是不通的,这个时候启动程序, 也会是正常的。请高手指教。'--------------------------------------------------
程序如下:Dim QtSQLcnn_ As ADODB.Connection '# 连接ActiveConnectionPrivate Sub Form_Load()
Dim lsQtSQLConnStr As String
'1.打开数据
Set QtSQLcnn_ = New ADODB.Connection
Set QtSQLCommand_ = New ADODB.Command
lsQtSQLConnStr = "Provider=SQLOLEDB.1;Persist Security " & _
"Info=False;Initial Catalog=" & _
"dbfront" & ";Data Source=" & _
"cf" & ";User ID=" & _
"sa" & ";Password=" & _
"3344" & ";"
QtSQLcnn_.Open lsQtSQLConnStr
End SubPrivate Sub Command1_Click() Dim Dbf_Key As ADODB.Recordset
Set Dbf_Key = New ADODB.Recordset
Dbf_Key.Open "select mc from keyset", QtSQLcnn_, adOpenKeyset, adLockReadOnly, adCmdUnknownEnd Sub‘------
在程序的LOAD事件中,用ADO 连接到了本机(机器名就是cf),在局域网络通的情况下运行该程序,
点击运行Command1_Click()正常,把网络线拔掉,再执行点击运行Command1_Click(),会出现下面的
提示:
[DBNETLIB][ConnectionWrite (send()).]General network
error.Check your network documentation. 也就是说:当把网络线拔掉竟然会断开连接本机的sqlserver??但假如网络本来是不通的,这个时候启动程序, 也会是正常的。请高手指教。'--------------------------------------------------
程序如下:Dim QtSQLcnn_ As ADODB.Connection '# 连接ActiveConnectionPrivate Sub Form_Load()
Dim lsQtSQLConnStr As String
'1.打开数据
Set QtSQLcnn_ = New ADODB.Connection
Set QtSQLCommand_ = New ADODB.Command
lsQtSQLConnStr = "Provider=SQLOLEDB.1;Persist Security " & _
"Info=False;Initial Catalog=" & _
"dbfront" & ";Data Source=" & _
"cf" & ";User ID=" & _
"sa" & ";Password=" & _
"3344" & ";"
QtSQLcnn_.Open lsQtSQLConnStr
End SubPrivate Sub Command1_Click() Dim Dbf_Key As ADODB.Recordset
Set Dbf_Key = New ADODB.Recordset
Dbf_Key.Open "select mc from keyset", QtSQLcnn_, adOpenKeyset, adLockReadOnly, adCmdUnknownEnd Sub‘------
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货