Unix Technical Forum

ODBC catalog function call return error on sql server 2005

This is a discussion on ODBC catalog function call return error on sql server 2005 within the MS SQL ODBC forums, part of the Microsoft SQL Server category; --> Hi, I am having a problem for the ODBC catalog functions, the server is sql server 2005 express beta2 ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > MS SQL ODBC

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 09:42 PM
=?Utf-8?B?SmluZw==?=
 
Posts: n/a
Default ODBC catalog function call return error on sql server 2005

Hi,

I am having a problem for the ODBC catalog functions, the
server is sql server 2005 express beta2 and sql server 2005 beta2.

the code is as follows:

----------

RETCODE nRetCode;

AFX_SQL_ASYNC(this, SQLTables( m_hstmt,
(m_strQualifierParam.IsEmpty()? (UCHAR FAR *)NULL: (UCHAR FAR *)(const
char*) m_strQualifierParam),
SQL_NTS,
(m_strOwnerParam.IsEmpty()? (UCHAR FAR *)NULL: (UCHAR FAR *)(const
char*)m_strOwnerParam),
SQL_NTS,
(m_strTableNameParam.IsEmpty()? (UCHAR FAR *)NULL: (UCHAR FAR *)(const
char*)m_strTableNameParam),
SQL_NTS,
(m_strTableTypeParam.IsEmpty()? (UCHAR FAR *)NULL: (UCHAR FAR *)(const
char*)m_strTableTypeParam),
SQL_NTS ));


UCHAR sqlState[6]; /* buffer to store SQLSTATE */
SDWORD nativeErr; /* native error code */
UCHAR errMsg[100]; /* buffer to store error message */
SWORD realMsgLen; /* real length of error message */

if( nRetCode == SQL_ERROR )
{

RETCODE etcode1 = SQLError( SQL_NULL_HDBC,
SQL_NULL_HDBC, m_hstmt, sqlState, &nativeErr, errMsg,
100, &realMsgLen);
}

----------

the parameter values for my case:
m_strQualifierParam, m_strOwnerParam, m_strTableTypeParam
are all empty
m_strTableNameParam is "bl" which is a table in the
database for sure.


the error values are:
sqlstate:s0002
nativeerr:208
errMsg: "Invalid object name '#sptables'"


I also got errors for function call to "SQLForeignKeys"
with the errMsg as "Invalid object name '#spfkeys'",
and "SQLPrimaryKeys" with errMsg as "Invalid object
name '#sppkeys'". I guess all catalog functions do not
work.

I have tried both the SQL Server 2005 and 2005 express.

The same code and database file .mdf just work perfectly
for SQL Server 2000. For the ODBC data source, I have
tried both SQL Server and SQL Native Client.


I do appreciate your help.

Thanks.

Jing

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 10:21 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com