Search Search

#1 worldwide
FREE Coding Lessons

since 1996
   THE BEST WAY to learn ASP & Asp.net!
Advertise Here!
click for details
Credits Host:
DiscountASP.net
Server Admin:
The "Team"
Contact Info.
Charles M. Carroll

my Blog
[prev. Lesson]  Troubleshoot: Registered Components
     [next Lesson]  PWS: Personal Web Server Introduction

Connection Info by Christophe Wille
Christoph.Wille@softwing.com  http://www.softwing.com/iisdev

If you want to know what drivers and other vital details are being used for a DSN, here is some code to the rescue.

   filename=/learn/test/connectioninfo.asp

<Test Script Below>


<html><head>
<title>connectioninfo.asp by Christophe Wille http://www.softwing.com</title>
</head>
<!--#include file="lib_connectioninfo.asp"-->
<body>
<%
response.write "<hr>SQL Server Connection"
Call DSNinfo("DSN=student;uid=student;pwd=magic")
response.write "<hr>Access Connection Connection"
theDSN="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" 
theDSN=theDSN & server.mappath("/learn/test/biblio.mdb")
Call DSNInfo(theDSN)
%>
</body>
</html>

The Include file looks like this:

   filename=/learn/test/lib_connectioninfo.asp

<Test Script Below>


<%
SUB DSNInfo(strDSN)
Set cnn1 = Server.CreateObject("ADODB.Connection")
Set rsQuery = Server.CreateObject("ADODB.RecordSet")
cnn1.open strDSN 

response.write "ADO Version: " & cnn1.Version 
response.write "<BR>" & vbcrlf
response.write strVersionInfo & "DBMS Name: " & cnn1.Properties("DBMS Name") 
response.write "<BR>" & vbcrlf 
response.write "DBMS Version: " & cnn1.Properties("DBMS Version")
response.write "<BR>" & vbcrlf 
response.write "OLE DB Version: " & cnn1.Properties("OLE DB Version")
response.write "<BR>" & vbcrlf 
response.write "Provider Name: " & cnn1.Properties("Provider Name")
response.write "<BR>" & vbcrlf 
response.write "Provider Version: " & cnn1.Properties("Provider Version")
response.write "<BR>" & vbcrlf 
response.write "Provider Friendly Name: " & cnn1.Properties("Provider Friendly Name")
response.write "<BR>" & vbcrlf 

If 0 = Instr(LCase(cnn1.Properties("Provider Name")),"oledb") then
    ' ### no OLE DB Provider used, therefore :
    response.write "Driver Name: " & cnn1.Properties("Driver Name")
        response.write "<BR>" & vbcrlf 
    response.write "Driver Version: " & cnn1.Properties("Driver Version")
        response.write "<BR>" & vbcrlf 
    response.write "Driver ODBC Version: " & cnn1.Properties("Driver ODBC Version")
    response.write "<BR><BR>"
end if

Set rsQuery = nothing
Set cnn1 = nothing


END SUB
%>

There are many worthy charities!!. But perhaps help starving children in Africa or South America AND help Charles too. a $5 tip buys him lunch at McDonalds, a $20 tip buys his kid Hitoshi a new computer game, a $39 tip buys his daughter Michiko a few nice outfits. See our donor list.