当我在 windows 2008 32 位服务器中运行以下代码时,调用 connect() 时程序流转到 sckTest_Error()。
但是,当我在 windows 2008 64 位服务器中运行相同的代码时,会发生 RTE 并且程序流程会出错:
Private Sub Form_Load()
On Error GoTo error1
If (Not (Me.sckTest.State = sckConnected)) Then
'
'Log event for outbound client mode connectoin
If Me.sckTest.State <> sckClosed Then
Me.sckTest.Close
End If
'
MsgBox "Going to connect"
Me.sckTest.Connect "127.0.0.1", 0
MsgBox "Connecting"
If Me.sckTest.State = sckConnected Then
MsgBox "Connected"
End If
'
End If
Exit Sub
error1:
MsgBox "RTE " & Err.Number
End Sub
Private Sub sckTest_Error(ByVal Number As Integer,
Description As String,
ByVal Scode As Long,
ByVal Source As String,
ByVal HelpFile As String,
ByVal HelpContext As Long,
CancelDisplay As Boolean)
MsgBox "Error in connecting" & Number
End Sub
但我在两台服务器上都收到错误 10049。任何人都可以建议它与我的代码或服务器行为有关的问题。
谢谢