Dim g_cnn As ADODB.Connection   '全局连接对象
Dim g_rec As ADODB.Recordset    '全局记录集
Dim g_cmd As New ADODB.Command
'###############################
Const sbcount As Integer = 2Dim topic(sbcount) As Label
Dim output_key(2, 12)   '0:name  1:ip   2:port   3:v1    4:v1 max    5:v2    6:v2 max    7:ip   8:port  9:keyword
Dim receive_data() As ByteDim ib_ttbj As Boolean             '探头报警
Dim ib_endcheck As Boolean         '完成检查报警
Dim ib_hrcz As Boolean             '换人超重,偷换人先上后下
Dim ib_zthr As Boolean             '中途换人,偷换人先下后上
Dim ib_wdjc As Boolean             '稳定性检测
Dim ib_wg   As Boolean             '中断违规,断网期间发生的违规Dim idec_BedHeight As Single        '床自身重量
Dim CtrlKey(100, 10) As String      '存放功能键值
Dim value_start(2), key_start(2), winsckflag(2) As Boolean
Dim value_len(2), key_len(2), clsnum
Dim Value(2, 200), keyword(2, 200)
Dim keyflag(2) As String               '判断标志符
'###############################
Private Sub Form_Load()
    str_bps = GetStringValue("HKEY_LOCAL_MACHINE\SOFTWARE\LFXT_Server\Com", "PJPRE")
    If str_bps = "Error" Then
    Else
        Text_pre.Text = str_bps
    End If
    
    str_bps = GetStringValue("HKEY_LOCAL_MACHINE\SOFTWARE\LFXT_Server\Com", "PJLEN")
    If str_bps = "Error" Then
         MsgBox "请票据长度!"
       SSTab1.Tab = 1
    Else
        Text_len.Text = str_bps
    End If
    Set g_cnn = New ADODB.Connection
    g_cnn.ConnectionString = "dsn=hy_yllfxt;uid=hurl;pwd="
    g_cnn.Open
    
    output_key(0, 0) = "HD301-A"
    output_key(0, 1) = "192.168.244.11"
    output_key(0, 2) = 10001
    output_key(0, 7) = "192.168.244.12"
    output_key(0, 8) = 10002
    output_key(1, 0) = "HD301-B"
    output_key(1, 1) = "192.168.244.21"
    output_key(1, 2) = 10001
    output_key(1, 7) = "192.168.244.22"
    output_key(1, 8) = 10002
    
    winsck(0).RemoteHost = output_key(0, 1)
    winsck(0).RemotePort = output_key(0, 2)
    winsck(1).RemoteHost = output_key(0, 7)
    winsck(1).RemotePort = output_key(0, 8)
    'winsck(2).RemoteHost = output_key(1, 1)
    'winsck(2).RemotePort = output_key(1, 2)
    'winsck(3).RemoteHost = output_key(1, 7)
    'winsck(3).RemotePort = output_key(1, 8)
    For i = 0 To UBound(output_key)
        If Len(output_key(i, 1)) > 0 Then
            ret = i + 1 & "." & output_key(i, 0)
            List_winsock.AddItem ret, i
        End If
    Next
    topic(0).Caption = "Ready to connect to " + output_key(0, 1)
    topic(1).Caption = "Ready to connect to " + output_key(0, 7)
    scktimer.Interval = 5000
    scktimer.Enabled = False
    stopsck.Enabled = False
    errstr(1).Enabled = False
    idec_BedHeight = 0
    
     '本程序只能运行一次的判断
    If App.PrevInstance = True Then '判断程序是否已运行,如果为真
        Title = App.Title '记录下本程序的标题
        Call MsgBox(App.Title + "(版本 " & App.Major & "." & App.Minor & "." & App.Revision & ")已运行!", vbInformation) '产生一个提示对话框
        App.Title = "第二次执行" '改变本程序标题,这样才不会激活自己
        AppActivate Title '激活先前已执行的程序
        Unload Me '结束本次执行之实例,保证仅运行一个程序
    End If
End Sub
示topic(0).Caption = "Ready to connect to " + output_key(0, 1)一行,对象变量或with块变量未设置???
请问哪里错了???该怎样修改??谢谢!!