Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error with CA x ADO x SQL Server
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00945695
Message ID:
00945802
Views:
22
>Fabio you are right.
>
>Why when I use SQL Pass Through its run OK ?
>
>SQL Pass Through use ODBC.
>
>Result in SQL profile WITH CA/ADO
>
>exec sp_executesql N'INSERT INTO "confeccao".."familia" ("CD_FAMILIA","DS_FAMILIA") VALUES (@P1,@P2)', N'@P1 varchar(4),@P2 varchar(30)', '0001', 'teste
>
>
>Result in SQL profile WITH SPT
>
>INSERT INTO familia (cd_familia,ds_familia) values ('099','testee')
>
This is the BIG problem
( I do not write other words why I would become acid too much ),
when you use a parameter,
you ( and me ) cannot control the true script sended to the backend's server side.

The interface (ADO,ODBC,...) choice exec sp_.... or put the parameter values inline,
but i have't found a bit of information on help,docs,forum,.... for control this choice.

For your problem,
try to add the SELECT SCOPE... in CA.BeforeInsert() event.
PROC BeforeInsert
cInsertCmd = m.cInsertCmd + [ SELECT scope_identity() AS id]
but i cannot help more because i don't uses CAs.

A last word:
Attention, if the SQL2000 INSTEAD TRIGGERS don't support SCOPE_IDENTITY() ( a bug for me ).

Fabio
Previous
Reply
Map
View

Click here to load this message in the networking platform