Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to suppress ODBC client driver error dialogs?
Message
De
12/02/2016 01:49:06
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
11/02/2016 18:12:18
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows Server 2012 R2
Database:
MS SQL Server
Application:
Desktop
Virtual environment:
VirtualBox
Divers
Thread ID:
01631344
Message ID:
01631364
Vues:
76
>>
>>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.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform