萬盛學電腦網

 萬盛學電腦網 >> 網絡編程 >> asp編程 >> asp獲取數據庫的連接屬性的方法

asp獲取數據庫的連接屬性的方法

   asp獲取數據庫的連接屬性的方法

  Option Explicit

  dim objCNN

  dim intCTProps

  dim item

  dim vbCRLF

  vbCRLF = chr(10)

  Response.Write "" & vbCRLF

  Response.Write "

  春風精彩之查看數據庫屬性" & vbCRLF

  Response.Write vbCRLF

  set objCNN = Server.CreateObject("ADODB.connection")

  objCNN.Open "DSN=VicTest"

  Response.Write ">編號" & vbCRLF

  Response.Write ">Name>值" & vbCRLF

  intCTProps = 0

  for each item in objCNN.Properties

  intCTProps = intCTProps + 1

  Response.Write "" & intCTProps & "" & vbCRLF

  Response.Write "" & item.name & "" & vbCRLF

  Response.Write "" & item.value & "" & vbCRLF

  next

  Response.Write "" & vbCRLF

  Response.Write vbCRLF

  Response.Write "" & vbCRLF

  set objCNN = Nothing

  set intCTProps = nothing

  set item = nothing

  set vbCRLF = nothing

  %>

copyright © 萬盛學電腦網 all rights reserved