Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get Version of ODBC from VFP
Message
 
 
To
29/08/2010 10:03:57
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01479042
Message ID:
01479123
Views:
62
>>>>Hi,
>>>>
>>>>I know I have asked this question before and I believe that Sergey answered it but I can't find the answer searching through messages on UT. And I forgot how to do it. Therefore, sorry for repeating the question.
>>>>
>>>>How do you get the version of ODBC driver VFP 9 is using from VFP Command window?
>>>
>>>You may use the GetODBCdrvrs() method of the ODBC Registry Foundation Class.
>>
>>Thank you. I will check it out.
>
>Depending on the name convention used by the driver, it may be sufficient or not.
>
>If you have an established connection, you may get driver's version and other info via the ODBC API.
>
>Check http://www.news2news.com/vfp/?example=289.

I tried to get the version from the established connection (as you suggested) using the following syntax:
FUNCTION GetOdbcVer
PARAMETER nHandle   && Passing existing connection handle

 DECLARE SHORT SQLGetInfo IN odbc32;
        INTEGER ConnectionHandle, INTEGER InfoType,;
        STRING @InfoValuePtr, INTEGER BufLen, INTEGER @StrLenPtr

LOCAL lcBuffer, lnBufLen
lcBuffer = REPLI(Chr(0), 4096)
lnBufLen = 0

*-- Parameter to get ODBC version (according to the code on news2news)
lnInfoType = 77

= SQLGetInfo (nHandle, lnInfoType, @lcBuffer, Len(lcBuffer), @lnBufLen)
The problem is that I get error "Declare DLL call caused exception" on calling SqlGetInfo() (last line). If anybody sees what I am missing, please let me know. Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform