Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ODBC Question...
Message
From
26/03/2003 06:00:13
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
25/03/2003 17:05:18
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00769963
Message ID:
00770142
Views:
22
>I want to be able to make my data methods be able to access tables in either MS SQL Server or VFP databases. I've set up an MS SQL data source and a VFP data source. The tables in each are basically identical in design taking in consideration the differences of MS SQL and VFP. Without having to maintain two separate versions of my data engine I'd like to be able to access either set of tables depending on the circumstances. For development and demos I'd probably set it up to run against VFP data. For live production systems I want to run it against MS SQL Server.
>
>My problem is this: When accessing the MS SQL server I can include code at the bottom of the SQL UPDATE command to check the @@ROWCOUNT property and if it is zero I can raise an error to report it back to the VFP method which takes appropriate action. That works. However, when accessing a VFP table via SQL Pass Through there is no way I can find to detect if the command affected any rows in the table. The _TALLY system variable is not affected by ODBC commands.
>
>So,my question is: Is there a way to detect if a SQL UPDATE command did or did not affect data in any rows?

Jim,
You could still run something like :
SQLExec(lnHandle,"select @@RowCount as RowsAffected","crsAffected")

However checking SQLExec return value and aerror in case sounds to be a better way.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform