Code: % Const adSchemaTables = 20 adSchemaColumns = 4 dim Conn,db dim ConnStr db="temp.mdb" 'ACCESS数据库的文件名,请使用相对于网站根目录的的绝对路径 ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" Server.MapPath(db) Set conn = Server.CreateObject("ADODB.Connection") conn.Open connstr
Dim rstSchema Dim I
Set rstSchema = Conn.OpenSchema(adSchemaTables)
Do while not rstSchema.EOF response.write("Table name: " rstSchema("TABLE_NAME") vbCr _ "Table type: " rstSchema("TABLE_TYPE") vbCr) response.write("br/>") I = I + 1 rstSchema.MoveNext Loop rstSchema.Close
Code: 查询: SELECT MSysObjects.Name FROM MsysObjects WHERE (Left([Name],1)>"~") AND (MSysObjects.Type)=5 ORDER BY MSysObjects.Name;
窗体: SELECT MSysObjects.Name FROM MsysObjects WHERE (Left([Name],1)>"~") AND (MSysObjects.Type)=-32768 ORDER BY MSysObjects.Name;
表: SELECT MSysObjects.Name FROM MsysObjects WHERE (Left([Name],1)>"~") AND (Left$([Name],4) > "Msys") AND (MSysObjects.Type)=1 ORDER BY MSysObjects.Name;
报表: SELECT MSysObjects.Name FROM MsysObjects WHERE (Left([Name],1)>"~") AND (MSysObjects.Type)= -32764 ORDER BY MSysObjects.Name;
模块: SELECT MSysObjects.Name FROM MsysObjects WHERE (Left([Name],1)>"~") AND (MSysObjects.Type)= -32761 ORDER BY MSysObjects.Name;
宏: SELECT MSysObjects.Name FROM MsysObjects WHERE (Left([Name],1)>"~") AND (MSysObjects.Type)= -32766 ORDER BY MSysObjects.Name;