ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 在ASP中获得ADO的连接信息(转)

在ASP中获得ADO的连接信息(转)

原创 Linux操作系统 作者:jcszjswkzhou 时间:2019-03-27 14:09:05 0 删除 编辑
<%
Sub ConnectionInfo(strcnn)
  Dim cnn
  Set cnn = Server.CreateObject("ADODB.Connection")
  cnn.Open strcnn
  Response.Write "ADO Version: " &_
  cnn.Version & "
" & vbCrlf
  Response.Write "DBMS Name: " &_
  cnn.Properties("DBMS Name") & "
" & vbCrlf
  Response.Write "OLE DB Version: " &_
  cnn.Properties("OLE DB Version") & "
" & vbCrlf
  Response.Write "Provider Name: " &_
  cnn.Properties("Provider Name") & "
" & vbCrlf
  Response.Write "Provider Version: " &_
  cnn.Properties("Provider Version") & "
" & vbCrlf
  Response.Write "Provider Friendly Name: " &_
  cnn.Properties("Provider Friendly Name") & "
" & vbCrlf
  If Instr(LCase(cnn.Properties("Provider Name")),"oledb") = 0 Then
   Response.Write "Driver Name: " &_
   cnn.Properties("Driver Name") & "
" & vbCrlf
   Response.Write "Driver Version: " &_
   cnn.Properties("Driver Version") & "
" & vbCrlf
   Response.Write "Driver ODBC Version: " &_
   cnn.Properties("Driver ODBC Version") & "
" & vbCrlf
  End If
  cnn.Close
  Set cnn = Nothing
End Sub
%>


<%
Dim strcnn
strcnn = "provider=sqloledb;data source=.;initial catalog=pubs;user id=sa;password=;"
Call ConnectionInfo(strcnn)
%>


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10294527/viewspace-124607/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2007-08-29

  • 博文量
    3008
  • 访问量
    2218038