Solved

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

Posted on 2015-02-10
5
137 Views
Last Modified: 2015-02-11
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..
0
Comment
Question by:Bill Ross
  • 2
  • 2
5 Comments
 
LVL 41

Accepted Solution

by:
pcelba earned 500 total points
ID: 40602014
0
 
LVL 14

Author Comment

by:Bill Ross
ID: 40602324
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
 
LVL 3

Expert Comment

by:Onisan
ID: 40602518
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
 
LVL 41

Expert Comment

by:pcelba
ID: 40602802
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
 
LVL 14

Author Closing Comment

by:Bill Ross
ID: 40602844
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

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
Technology opened people to different means of presenting information, but PowerPoint remains to be above competition. Know why PPT still works today.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now