IIS Development

IisDev

>  Home
>  News
>  Notification Service

 

Articles

>  Code Samples
>  ASP.NET
>  Security

 

Components & Tools

>  Free Components
>  SharpDevelop
>  ComponentCenter
>  CodeLook Program

 

Service

>  Links
>  Advertising
>  Contact us

Search IISDEV:

ADO Version/Property checking script

Last updated: 11/15/98, Initial Release


There are many versions of ADO around, and each of these has "slight" differences in what features are supported - just recall version 1.5 (with version a through ?). So how do you know which version of ADO is running on your (or your ISP's) web server? Luckily, the ADO objects expose the Properties collection which allows you to browse for properties ranging from ADO version, ODBC driver version, DBMS version and name, and more.

The script we have provided asks for the DSN, a username and password as well as a tablename so it can go along and see which properties are supported by recordsets on this connection (ie bookmarkable is not supported with Access databases). You can see a SQL Server output here, taken from our guestbook service.

The main script code is presented below: first a connection object is created, a connection established and then information about the DBMS, the drivers and versions is gathered (ADO version information). The next step is to print all properties for the current connection as well as properties for the selected table.

Set cnn1 = Server.CreateObject("ADODB.Connection")
cnn1.open strDSN,strUser,strPwd

strVersionInfo = "ADO Version: " & cnn1.Version & "<BR>" & vbcrlf
strVersionInfo = strVersionInfo & "DBMS Name: " & cnn1.Properties("DBMS Name") & "<BR>" & vbcrlf 
strVersionInfo = strVersionInfo & "DBMS Version: " & cnn1.Properties("DBMS Version") & "<BR>" & vbcrlf 
strVersionInfo = strVersionInfo & "OLE DB Version: " & cnn1.Properties("OLE DB Version") & "<BR>" & vbcrlf 
strVersionInfo = strVersionInfo & "Provider Name: " & cnn1.Properties("Provider Name") & "<BR>" & vbcrlf 
strVersionInfo = strVersionInfo & "Provider Version: " & cnn1.Properties("Provider Version") & "<BR>" & vbcrlf 
strVersionInfo = strVersionInfo & "Driver Name: " & cnn1.Properties("Driver Name") & "<BR>" & vbcrlf 
strVersionInfo = strVersionInfo & "Driver Version: " & cnn1.Properties("Driver Version") & "<BR>" & vbcrlf 
strVersionInfo = strVersionInfo & "Driver ODBC Version: " & cnn1.Properties("Driver ODBC Version") & "<BR><BR>"

Response.Write "<B>ADO Version information</B>:<BR>"
Response.Write strVersionInfo

Response.Write "<B>Connection Properties</B>:<BR>"
For Each connprop In cnn1.properties
	Response.Write connprop.name & ": <I>" & connprop &  "</I><BR>" & vbCRLF
Next

Response.Write "<BR>"
Response.Write "<B>Recorset Properties</B>:<BR>"

Set rsQUery = Server.CreateObject("ADODB.RecordSet")
strQuery = strTable
rsQuery.Open strQuery, cnn1
For Each rsprop In rsQuery.properties
	Response.Write rsprop.name & ": <I>" & rsprop &  "</I><BR>" & vbCRLF
Next

The most vital information can be drawn from the first part: ADO version information, which helps you to identify driver versions. Also important are the features of recordsets, which differ from DBMS to DBMS.

Download

Download (size is approx. 1KB)
The script has been tested with IIS 4.0 and ADO 2.0 (Windows NT 4.0 SP4)

If you do have any questions, please feel free to send mail to Christoph Wille.

 

©1998-2004 Christoph Wille. All rights reserved.
All content and images on this site are copyright. Reuse (even parts) needs our written consent.