RE: odbccommand cant interpret some /*xxx*/ comments



Hi Pak, thanks again! this is theinfo you requested:

version of "sqlsrv32.dll" --> 3.70.9.61 (SQL 7)
OS --> WIN XP SP2
MDAC Version --> MDAC 2.8 SP1 ON WINDOWS XP SP2

about changing the comments i've tried many ways, finding the only one thats
works is replacing the word select in the comment. y already have wirten a
code to workaround this problem, since i cant remove the comments .
regards and thaks again for your time!

"Pak-Ming Cheung [MSFT]" wrote:

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!

.



Relevant Pages

  • RE: Microsoft OLE DB Provider for SQL Server (0x80004005)
    ... > This error is being generated from an ASP page to a SQL Server 2000 ... > run the Stored Procedure on the database server itself: ... Microsoft says it might be a connection pooling issue. ... this is the only stored procedure that generates this error. ...
    (microsoft.public.scripting.vbscript)
  • Microsoft OLE DB Provider for SQL Server (0x80004005)
    ... General network error. ... This error is being generated from an ASP page to a SQL Server 2000 ... Microsoft says it might be a connection pooling issue. ... this is the only stored procedure that generates this error. ...
    (microsoft.public.scripting.vbscript)
  • Microsoft OLE DB Provider for SQL Server (0x80004005)
    ... General network error. ... This error is being generated from an ASP page to a SQL Server 2000 ... Microsoft says it might be a connection pooling issue. ... this is the only stored procedure that generates this error. ...
    (microsoft.public.data.oledb)
  • Re: Microsoft OLE DB Provider for SQL Server (0x80004005)
    ... > This error is being generated from an ASP page to a SQL Server 2000 ... Microsoft says it might be a connection pooling ... this is the only stored procedure that generates this ... then have the web page to submit SET ARITHABORT ON. ...
    (microsoft.public.data.oledb)
  • Re: How to get list of EventClasses in MSSQLServer2000
    ... statement inside a stored procedure has completed.') ... SQL Server statement or stored procedure.') ... Plan','Displays the plan tree of the Transact-SQL statement executed.') ... Login','Occurs when a SQL Server login is added or removed; ...
    (microsoft.public.sqlserver.security)

Loading