Can I use VBA to determine the SQL Native Client version?

Some computers have SQL Native Client 10.0 others have  11.0.  Can I determine which version is installed via code?  If so I can adjust the connection string.  Thanks..
LVL 14
Bill RossAsked:
Who is Participating?
 
pcelbaCommented:
0
 
Bill RossAuthor Commented:
Do you know of a good fast test to see if the connection works.  I seem to run into a long wait if the wrong driver is tested.
0
 
OnisanCoder / ProgrammerCommented:
If you can connect to it there are two ways I know of.
Run a Select query:     SELECT @@VERSION as 'SQL Server Version'
Call the stored procedure  xp_msver
0
 
pcelbaCommented:
You should be able to set connection timeout before the connection is established. But if the delay is problem then you should read the list of available ODBC drivers from Windows Registry as showed in links from my previous post.
0
 
Bill RossAuthor Commented:
Hi,

I ended up using a test to determine which driver was installed using the code from vbforums.  Thanks for pointing me in the right direction.

Bill
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.