如何从应用程序用于连接的跟踪日志中获取ODBC名称(在本例中为:Firebird数据库)
AutoReps 1f8c-140c ENTER SQLAllocEnv
HENV * 0x5D67B1AC
AutoReps 1f8c-140c EXIT SQLAllocEnv with return code 0 (SQL_SUCCESS)
HENV * 0x5D67B1AC ( 0x02E61078)
AutoReps 1f8c-140c ENTER SQLGetEnvAttr
SQLHENV 0x02E61078
SQLINTEGER 201 <SQL_ATTR_CONNECTION_POOLING>
SQLPOINTER 0x0012EA64
SQLINTEGER 4
SQLINTEGER * 0x0012EA60
AutoReps 1f8c-140c EXIT SQLGetEnvAttr with return code 0 (SQL_SUCCESS)
SQLHENV 0x02E61078
SQLINTEGER 201 <SQL_ATTR_CONNECTION_POOLING>
SQLPOINTER 0x0012EA64 (0) <SQL_CP_OFF>
SQLINTEGER 4
SQLINTEGER * 0x0012EA60 (0)
AutoReps 1f8c-140c ENTER SQLAllocEnv
HENV * 0x5D67B1B0
AutoReps 1f8c-140c EXIT SQLAllocEnv with return code 0 (SQL_SUCCESS)
HENV * 0x5D67B1B0 ( 0x02E610F0)
AutoReps 1f8c-140c ENTER SQLSetEnvAttr
SQLHENV 0x02E610F0
SQLINTEGER 201 <SQL_ATTR_CONNECTION_POOLING>
SQLPOINTER 0 <SQL_CP_OFF>
SQLINTEGER -6
AutoReps 1f8c-140c EXIT SQLSetEnvAttr with return code 0 (SQL_SUCCESS)
SQLHENV 0x02E610F0
SQLINTEGER 201 <SQL_ATTR_CONNECTION_POOLING>
SQLPOINTER 0 <SQL_CP_OFF>
SQLINTEGER -6
AutoReps 1f8c-140c ENTER SQLAllocConnect
HENV 0x02E610F0
HDBC * 0x0012F6F0
AutoReps 1f8c-140c EXIT SQLAllocConnect with return code 0 (SQL_SUCCESS)
HENV 0x02E610F0
HDBC * 0x0012F6F0 ( 0x02E61388)
AutoReps 1f8c-140c ENTER SQLGetInfoW
HDBC 0x02E61388
UWORD 10 <SQL_ODBC_VER>
PTR 0x0012F6C0
SWORD 22
SWORD * 0x00000000
AutoReps 1f8c-140c EXIT SQLGetInfoW with return code 0 (SQL_SUCCESS)
HDBC 0x02E61388
UWORD 10 <SQL_ODBC_VER>
PTR 0x0012F6C0 [ -3] "03.80.0000\ 0"
SWORD 22
SWORD * 0x00000000
AutoReps 1f8c-140c ENTER SQLSetConnectAttrW
SQLHDBC 0x02E61388
SQLINTEGER 103 <SQL_ATTR_LOGIN_TIMEOUT>
SQLPOINTER 15
SQLINTEGER -6
AutoReps 1f8c-140c EXIT SQLSetConnectAttrW with return code 0 (SQL_SUCCESS)
SQLHDBC 0x02E61388
SQLINTEGER 103 <SQL_ATTR_LOGIN_TIMEOUT>
SQLPOINTER 15
SQLINTEGER -6
AutoReps 1f8c-140c ENTER SQLDriverConnectW
HDBC 0x02E61388
HWND 0x00000000
WCHAR * 0x6D5F8B34 [ -3] "******\ 0"
SWORD -3
WCHAR * 0x6D5F8B34
SWORD -3
SWORD * 0x00000000
UWORD 0 <SQL_DRIVER_NOPROMPT>
AutoReps 1f8c-140c EXIT SQLDriverConnectW with return code -1 (SQL_ERROR)
HDBC 0x02E61388
HWND 0x00000000
WCHAR * 0x6D5F8B34 [ -3] "******\ 0"
SWORD -3
WCHAR * 0x6D5F8B34
SWORD -3
SWORD * 0x00000000
UWORD 0 <SQL_DRIVER_NOPROMPT>
DIAG [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0)
AutoReps 1f8c-140c ENTER SQLGetDiagRecW
SQLSMALLINT 2 <SQL_HANDLE_DBC>
SQLHANDLE 0x02E61388
SQLSMALLINT 1
SQLWCHAR * 0x0012F654
SQLINTEGER * 0x0012F22C
SQLWCHAR * 0x0012F254
SQLSMALLINT 512
SQLSMALLINT * 0x0012F23C
AutoReps 1f8c-140c EXIT SQLGetDiagRecW with return code 0 (SQL_SUCCESS)
SQLSMALLINT 2 <SQL_HANDLE_DBC>
SQLHANDLE 0x02E61388
SQLSMALLINT 1
SQLWCHAR * 0x0012F654 [ 5] "IM002"
SQLINTEGER * 0x0012F22C (0)
SQLWCHAR * 0x0012F254 [ 91] "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"
SQLSMALLINT 512
SQLSMALLINT * 0x0012F23C (91)
AutoReps 1f8c-140c ENTER SQLGetDiagRecW
SQLSMALLINT 2 <SQL_HANDLE_DBC>
SQLHANDLE 0x02E61388
SQLSMALLINT 2
SQLWCHAR * 0x0012F654
SQLINTEGER * 0x0012F22C
SQLWCHAR * 0x0012F254
SQLSMALLINT 512
SQLSMALLINT * 0x0012F23C
AutoReps 1f8c-140c EXIT SQLGetDiagRecW with return code 100 (SQL_NO_DATA_FOUND)
SQLSMALLINT 2 <SQL_HANDLE_DBC>
SQLHANDLE 0x02E61388
SQLSMALLINT 2
SQLWCHAR * 0x0012F654
SQLINTEGER * 0x0012F22C
SQLWCHAR * 0x0012F254
SQLSMALLINT 512
SQLSMALLINT * 0x0012F23C
AutoReps 1f8c-140c ENTER SQLFreeConnect
HDBC 0x02E61388
AutoReps 1f8c-140c EXIT SQLFreeConnect with return code 0 (SQL_SUCCESS)
HDBC 0x02E61388
AutoReps 1f8c-140c ENTER SQLFreeEnv
HENV 0x02E61078
AutoReps 1f8c-140c EXIT SQLFreeEnv with return code 0 (SQL_SUCCESS)
HENV 0x02E61078
AutoReps 1f8c-140c ENTER SQLFreeEnv
HENV 0x02E610F0
AutoReps 1f8c-140c EXIT SQLFreeEnv with return code 0 (SQL_SUCCESS)
HENV 0x02E610F0
AutoReps 1214-5e8 ENTER SQLAllocEnv
HENV * 0x5D67B1AC
AutoReps 1214-5e8 EXIT SQLAllocEnv with return code 0 (SQL_SUCCESS)
HENV * 0x5D67B1AC ( 0x02E61E60)
AutoReps 1214-5e8 ENTER SQLGetEnvAttr
SQLHENV 0x02E61E60
SQLINTEGER 201 <SQL_ATTR_CONNECTION_POOLING>
SQLPOINTER 0x0012EA64
SQLINTEGER 4
SQLINTEGER * 0x0012EA60
AutoReps 1214-5e8 EXIT SQLGetEnvAttr with return code 0 (SQL_SUCCESS)
SQLHENV 0x02E61E60
SQLINTEGER 201 <SQL_ATTR_CONNECTION_POOLING>
SQLPOINTER 0x0012EA64 (0) <SQL_CP_OFF>
SQLINTEGER 4
SQLINTEGER * 0x0012EA60 (0)
AutoReps 1214-5e8 ENTER SQLAllocEnv
HENV * 0x5D67B1B0
AutoReps 1214-5e8 EXIT SQLAllocEnv with return code 0 (SQL_SUCCESS)
HENV * 0x5D67B1B0 ( 0x02E61ED8)
AutoReps 1214-5e8 ENTER SQLSetEnvAttr
SQLHENV 0x02E61ED8
SQLINTEGER 201 <SQL_ATTR_CONNECTION_POOLING>
SQLPOINTER 0 <SQL_CP_OFF>
SQLINTEGER -6
AutoReps 1214-5e8 EXIT SQLSetEnvAttr with return code 0 (SQL_SUCCESS)
SQLHENV 0x02E61ED8
SQLINTEGER 201 <SQL_ATTR_CONNECTION_POOLING>
SQLPOINTER 0 <SQL_CP_OFF>
SQLINTEGER -6
AutoReps 1214-5e8 ENTER SQLAllocConnect
HENV 0x02E61ED8
HDBC * 0x0012F6F0
AutoReps 1214-5e8 EXIT SQLAllocConnect with return code 0 (SQL_SUCCESS)
HENV 0x02E61ED8
HDBC * 0x0012F6F0 ( 0x002493F0)
AutoReps 1214-5e8 ENTER SQLGetInfoW
HDBC 0x002493F0
UWORD 10 <SQL_ODBC_VER>
PTR 0x0012F6C0
SWORD 22
SWORD * 0x00000000
AutoReps 1214-5e8 EXIT SQLGetInfoW with return code 0 (SQL_SUCCESS)
HDBC 0x002493F0
UWORD 10 <SQL_ODBC_VER>
PTR 0x0012F6C0 [ -3] "03.80.0000\ 0"
SWORD 22
SWORD * 0x00000000
AutoReps 1214-5e8 ENTER SQLSetConnectAttrW
SQLHDBC 0x002493F0
SQLINTEGER 103 <SQL_ATTR_LOGIN_TIMEOUT>
SQLPOINTER 15
SQLINTEGER -6
AutoReps 1214-5e8 EXIT SQLSetConnectAttrW with return code 0 (SQL_SUCCESS)
SQLHDBC 0x002493F0
SQLINTEGER 103 <SQL_ATTR_LOGIN_TIMEOUT>
SQLPOINTER 15
SQLINTEGER -6
AutoReps 1214-5e8 ENTER SQLDriverConnectW
HDBC 0x002493F0
HWND 0x00000000
WCHAR * 0x6D5F8B34 [ -3] "******\ 0"
SWORD -3
WCHAR * 0x6D5F8B34
SWORD -3
SWORD * 0x00000000
UWORD 0 <SQL_DRIVER_NOPROMPT>
AutoReps 1214-5e8 EXIT SQLDriverConnectW with return code -1 (SQL_ERROR)
HDBC 0x002493F0
HWND 0x00000000
WCHAR * 0x6D5F8B34 [ -3] "******\ 0"
SWORD -3
WCHAR * 0x6D5F8B34
SWORD -3
SWORD * 0x00000000
UWORD 0 <SQL_DRIVER_NOPROMPT>
DIAG [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified (0)
AutoReps 1214-5e8 ENTER SQLGetDiagRecW
SQLSMALLINT 2 <SQL_HANDLE_DBC>
SQLHANDLE 0x002493F0
SQLSMALLINT 1
SQLWCHAR * 0x0012F654
SQLINTEGER * 0x0012F22C
SQLWCHAR * 0x0012F254
SQLSMALLINT 512
SQLSMALLINT * 0x0012F23C
AutoReps 1214-5e8 EXIT SQLGetDiagRecW with return code 0 (SQL_SUCCESS)
SQLSMALLINT 2 <SQL_HANDLE_DBC>
SQLHANDLE 0x002493F0
SQLSMALLINT 1
SQLWCHAR * 0x0012F654 [ 5] "IM002"
SQLINTEGER * 0x0012F22C (0)
SQLWCHAR * 0x0012F254 [ 91] "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"
SQLSMALLINT 512
SQLSMALLINT * 0x0012F23C (91)
AutoReps 1214-5e8 ENTER SQLGetDiagRecW
SQLSMALLINT 2 <SQL_HANDLE_DBC>
SQLHANDLE 0x002493F0
SQLSMALLINT 2
SQLWCHAR * 0x0012F654
SQLINTEGER * 0x0012F22C
SQLWCHAR * 0x0012F254
SQLSMALLINT 512
SQLSMALLINT * 0x0012F23C
AutoReps 1214-5e8 EXIT SQLGetDiagRecW with return code 100 (SQL_NO_DATA_FOUND)
SQLSMALLINT 2 <SQL_HANDLE_DBC>
SQLHANDLE 0x002493F0
SQLSMALLINT 2
SQLWCHAR * 0x0012F654
SQLINTEGER * 0x0012F22C
SQLWCHAR * 0x0012F254
SQLSMALLINT 512
SQLSMALLINT * 0x0012F23C
AutoReps 1214-5e8 ENTER SQLFreeConnect
HDBC 0x002493F0
AutoReps 1214-5e8 EXIT SQLFreeConnect with return code 0 (SQL_SUCCESS)
HDBC 0x002493F0
AutoReps 1214-5e8 ENTER SQLFreeEnv
HENV 0x02E61E60
AutoReps 1214-5e8 EXIT SQLFreeEnv with return code 0 (SQL_SUCCESS)
HENV 0x02E61E60
AutoReps 1214-5e8 ENTER SQLFreeEnv
HENV 0x02E61ED8
AutoReps 1214-5e8 EXIT SQLFreeEnv with return code 0 (SQL_SUCCESS)
HENV 0x02E61ED8
答案 0 :(得分:1)
不确定你的意思&#34; ODBC名称&#34; ...你的意思是目标数据库用户名吗?但是,SQLDriverConnect [W]具有以下语法:
SQLRETURN SQLDriverConnect(
SQLHDBC ConnectionHandle,
SQLHWND WindowHandle,
SQLCHAR * InConnectionString,
SQLSMALLINT StringLength1,
SQLCHAR * OutConnectionString,
SQLSMALLINT BufferLength,
SQLSMALLINT * StringLength2Ptr,
SQLUSMALLINT DriverCompletion);
通过阅读您的跟踪,它看起来像&#34; InConnectionString&#34;是&#34;&#34; ****** \ 0&#34;。他们可能试图掩盖它,因为连接字符串包含密码。 InConnectionString(后续字段)的长度为-3,表示:NULL终止。
错误表明其连接字符串包含错误的DSN