Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to suppress ODBC client driver error dialogs?
Message
From
12/02/2016 02:56:34
 
 
To
12/02/2016 01:49:06
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Client/server
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows Server 2012 R2
Database:
MS SQL Server
Application:
Desktop
Virtual environment:
VirtualBox
Miscellaneous
Thread ID:
01631344
Message ID:
01631369
Views:
61
>>>
>>>sqlsetprop(0, 'DispLogin', 3)
>>>sqlsetprop(0, 'DispWarnings', .f.)
>>>
>>
>>Thanks, Hugo - that's what I was looking for. The important thing to note (for me) was 0 as the first parameter of the calls - from Help: "To specify Visual FoxPro default settings at the environment level, include 0 as the statement handle." This lets the function work *before* a connection is (not) made.
>>
>>UPDATE: for lurkers - on a failure of SQLSTRINGCONNECT(), AERROR() contains all the information in the first dialog of my initial post (plus more).
>
>That's actually true of any sql* call, aError() will return whatever the ODBC driver complains about (which is mostly passing the messages from SQL server).
>
>BTW, one thing which isn't widely known - I've seen a few old foxen who didn't know this, is the nature of the number returned by sqlexec() containing a select statement, or more statements. It's the number of cursors it returns. Which is not quite correct - in case it returns no cursors (like when you pass an empty string or just sqlexec(h, "/* comment */", "xx") then the result is still 1. But if it returns more than 1, that's what it is.

Yes, the help says that if the return value is more than 1, it represents the number of "result sets" returned. But it looks pretty kludgy to get more than 1 result back from a single SQLEXEC(). Have you ever needed to do that?

The return value also looks like it's "overloaded" to some extent. In Async mode it returns 0 if still executing, 1 if finished (maybe more than 1?). And -1 on error.

Didn't know about getting a return value of 1 even for a "dummy" SQLEXEC() statement. Maybe that represents successful completion (?)
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform