问题就出现在这个程序段里,请有心人帮帮我!

代码: 全选
Private Sub connect()
Dim tmpstat As Long
If isconnect = True Then
Exit Sub
End If
If sqlallocenv(henv) Then
MsgBox "无法初始化ODBC环境!", , "ODBC API执行错误"
End
End If
If sqlallocconnect(henv, hdbc) Then
MsgBox "无法连接ODBC!", , "ODBC API执行错误"
End
End If
tmpstat = sqlconnect(hdbc, dsn, Len(dsn), db_user_name, lench(db_user_name), db_password, Len(db_password))
If tmpstat <> sql_success_with_info Then
MsgBox "无法连接句柄!", , "ODBC API执行错误"
isconnect = True
disconnect
End
End If
isconnect = True
End Sub