RE: odbccommand cant interpret some /*xxx*/ comments
- From: Pak-Ming Cheung [MSFT] <PakMingCheungMSFT@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 21 Aug 2008 00:36:01 -0700
Mauro,
I have tried your query (creating stored procedure) with the API
SQLExecDirect in the driver "SQL Server". The problem doesn't reproduce.
So, i would like to first confirm whether you are using the driver
"sqlsrv32.dll" (released by Microsoft).
Which version of MDAC are you using?
Which OS are you using?
What is the file version and product version of "sqlsrv32.dll"?
Something worth trying:
- remove comment from stored procedure
- not to use multiple-line comments (code path may be different for
multiple-line comment and single-line comment)
Thanks,
Ming.
MDAC Team, Microsoft.
"Mauro SB" wrote:
Hi Pak, tnaks for anwser, finally i found the problem, it shows up if in the.
comment i use the word "select". i tried with many sql reserverd words, but
only select trigers the problem. i cant put all the code because of my
company restrictions but i give you the following info about the
scenario(weird scenario):
db server is : Adaptive Server Enterprise/12.5.4/EBF 14921
ESD#7/P/RS6000/AIX 5.1/ase1254/2095/64-bit/FBO/Fri Oct 12 12:11:32 2007
the odbc driver used is the one of SQL server 7
connection info:
OdbcConnection conn = new OdbcConnection();
StringBuilder str = new StringBuilder();
str.Append("Driver={SQL Server};");
str.Append("Server=" + ServerIP + ",");
str.Append(ServerPort + ";Network=DBMSSOCN;");
str.Append("UID=" + User + ";");
str.Append("PWD=" + Password + ";");
str.Append("Database=" + DBName + ";");
portion of code of the sp creation:
/*************************************************************************
select
*************************************************************************/
CREATE procedure spPrueba2
as
BEgIN
.
.
.
.
thaht will throw:
ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Incorrect
syntax near the keyword 'BEgIN'.
if you replace the select word in the comment with any other word, it runs
smothly.
tnks in advance for your time!
"Pak-Ming Cheung [MSFT]" wrote:
I have tested your given SProc in ODBC Test (shipped inside MDAC SDK 2.8). I
found that there is no problem if i put your given command into SQLExecDirect.
So, could you give us the exact program that can reproduce the problem?
Thanks,
Ming.
MDAC Team, Microsoft.
"Mauro SB" wrote:
Hi,
does anybody knows why can an odbccommand throw a "incorrect syntax near
begin" when i try to execute something like this:
/********************
**sp description **
********************/
create procedure spSomething
@var int
as
begin
.
.
.
end
if i split the coment it works fine, but i need the comment :D
executing from query analyzer or alikes works fine!! but not with ODBC
tnks in advance!
- Follow-Ups:
- RE: odbccommand cant interpret some /*xxx*/ comments
- From: Mauro SB
- RE: odbccommand cant interpret some /*xxx*/ comments
- References:
- odbccommand cant interpret some /*xxx*/ comments
- From: Mauro SB
- RE: odbccommand cant interpret some /*xxx*/ comments
- From: Pak-Ming Cheung [MSFT]
- RE: odbccommand cant interpret some /*xxx*/ comments
- From: Mauro SB
- odbccommand cant interpret some /*xxx*/ comments
- Prev by Date: Re: How to have SQL_ERROR returned from RAISERROR within IF-BLOCK
- Next by Date: Re: How to have SQL_ERROR returned from RAISERROR within IF-BLOCK
- Previous by thread: RE: odbccommand cant interpret some /*xxx*/ comments
- Next by thread: RE: odbccommand cant interpret some /*xxx*/ comments
- Index(es):
Relevant Pages
|