-
October 22nd, 2009, 04:42 AM
#1
[RESOLVED] Error while Database name is numeric in MySQL
Hi All
I am getting error when use command
Code:
USE 12;(12 is database name)
Error is given below
Code:
Microsoft SQL-DMO (ODBC SQLState: 42000) Error: -2147221334
[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near '12'.
Unknown error 0x800400AA
i am using code for use database is
Code:
Qry=spSQLServer->ExecuteWithResults((_bstr_t)"USE 12",(LONG)"IF EXISTS(SELECT * FROM sysdatabases WHERE name='12'".GetLength());
Plz help me
-
October 22nd, 2009, 04:58 AM
#2
Re: Error while Database name is numeric in MySQL
Maybe the double quote in ...name='12'".GetLength())
-
October 22nd, 2009, 05:15 AM
#3
Re: Error while Database name is numeric in MySQL
Originally Posted by olivthill2
Maybe the double quote in ...name='12'".GetLength())
Thanks for reply.
is not issue.
-
October 22nd, 2009, 05:53 AM
#4
Re: Error while Database name is numeric in MySQL
What looks strange to me is that you have "...(..."...), whereas usually, you have "...(...)..." or (..."..."...).
-
October 22nd, 2009, 06:34 AM
#5
Re: Error while Database name is numeric in MySQL
Originally Posted by Msm
i am using code for use database is
Code:
Qry=spSQLServer->ExecuteWithResults( (_bstr_t)"USE 12",
(LONG)"IF EXISTS(SELECT * FROM sysdatabases WHERE name='12'".
GetLength());
What a strange call!?
1. Why does the second parameter in ExecuteWithResults mean?
2. Why are you casting char* string to LONG?
3. FYI: the ExecuteWithResults signature is (from http://msdn.microsoft.com/en-us/libr...9(SQL.90).aspx ):
Code:
HRESULT ExecuteWithResults(
SQLDMO_LPCSTR Command,
LPSQLDMOQUERYRESULTS* ppResults,
long lLength CPPDEFAULT(= 0));
Victor Nijegorodov
-
October 22nd, 2009, 11:52 PM
#6
Re: Error while Database name is numeric in MySQL
thanks all problem solved
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|