77家的会客2010

asp取数据库中的表名
Weather:-5~0度,风好大的春天

<%'---------------读access库中的表名-------------------------
SET  Conn=Server.CreateObject("ADODB.Connection")
Conn.Open  "Driver={Microsoft Access Driver  (*.mdb)};DBQ="& Server.MapPath("库名称")
Set  rstSchema = Conn.OpenSchema(20)
  
Do Until  rstSchema.EOF
 Response.Write "Table name:"&  rstSchema(2)& "< br> "&  "Table type:"& rstSchema(3)& "<  br> < br> "
 rstSchema.MoveNext
Loop
%>
  <%'---------------读sql  server库中的表名-------------------------
SET  Conn=Server.CreateObject("ADODB.Connection")
Conn.Open  "Server=IP地址;Provider=sqloledb;Database=库名称;UID=用户名;PWD=密码;"
Set  rstSchema=Conn.OpenSchema(20)
  
Do Until  rstSchema.EOF
 Response.Write "Table name:"&  rstSchema(2)& "< br> "&  "Table type:"& rstSchema(3)& "<  br> < br> "
 rstSchema.MoveNext
Loop
%> 

  <%'---------------读oracle库中的表名-------------------------
SET  Conn=Server.CreateObject("ADODB.Connection")
Conn.Open  "Provider=MSDAORA.1;Password=密码;User ID=用户名;Data  Source=数据源名称"
Set  rstSchema=Conn.OpenSchema(20)
  
Do Until  rstSchema.EOF
 Response.Write "Table name:"&  rstSchema(2)& "< br> "&  "Table type:"& rstSchema(3)& "<  br> < br> "
 rstSchema.MoveNext
Loop

'Response.Write("所在数据库名:" & rs(0) & "
")
'Response.Write("所有者:" & rs(1) & "
")
'Response.Write("表 名:" & rs(2) & "
")
'Response.Write("表的类型:" & rs(3) & "
")
%>

历史上的今天: [2010/03/13]为谁写?
[2010/03/13]那一年的夏天,厦门,鼓浪

[asp取数据库中的表名]的回复

Post a Comment~