TMSStoredProc problem: Syntax error or access violation (-2147217900)

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
zedmartins
Posts: 18
Joined: Wed 11 Jul 2007 20:59
Location: Brazil

TMSStoredProc problem: Syntax error or access violation (-2147217900)

Post by zedmartins » Thu 06 Dec 2007 20:40

I found an error executing Stored Procedures using SDAC.

Inside the database on SQL Server 2000, I have two Stored Procedures with same name but different owners:
dbo.NOVO_CODIGO
teknisa.NOVO_CODIGO

Connected with user teknisa, I set the StoredProcName property of the MSStoredProc to "NOVO_CODIGO" (without the owner) and try to execute the procedure. I get the error:
Erro de sintaxe ou violação de acesso
(syntax error or access violation)

if I delete the other procedure (dbo.NOVO_CODIGO) the problem disappear.

I'm using SDAC 6.10.0.10 and MSDAC 2.

Is there a way to make it work without deleting the other procedure or adding the user/owner to the StoredProcName property?

We are stopping using Delphi ADO components and changing them to ODAC and SDAC. Modify the StoredProcName is hard to do 'cause the application is huge and there is a ton of forms and components to check.

Thanks a lot,

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Fri 07 Dec 2007 13:34

The best way to resolve this problem is to add the schema name to the stored procedure name explicitly. If the schema name is not specified, SDAC cannot determine, which of procedures to use because there is no enough information for that. By default the procedure from the dbo schema is used.
All we can do is to modify GetStoredProcNames methods to let retrieving stored procedure names with schema names.

zedmartins
Posts: 18
Joined: Wed 11 Jul 2007 20:59
Location: Brazil

Post by zedmartins » Fri 07 Dec 2007 14:15

I think I can add some code to some application library to add the schema automaticaly...

Thanks,

Post Reply