You can also judge whether the Access table exists without adox

xiaoxiao2021-03-06  58

Haha, you don't have to adox too! !

<%

DIM CN, STRCNN, RSTSCHEMA

Set cn = server.createObject ("adodb.connection") set strcnn = server.createObject ("adoDb.recordset") set rstschema = server.createObject ("adoDb.recordset")

Strcnn = "provider = microsoft.jet.Oledb.4.0;" strcnn = strcnn "data source = f: /ASPTEST/tree.mdb;" strcn = strcnn "

cn.Open strCnn set rstSchema = cn.openSchema (20) rstSchema.movefirstDo Until rstSchema.EOF if rstSchema ( "TABLE_TYPE") = "TABLE" then response.write rstSchema ( "TABLE_NAME") & "
" end if Rstschema.movenextLoopcn.Close

'set rstschema = Nothing'SET CN = NOTHING%>

SQL -> System Table SYSOBJECTS

Access --- "Examples of Adox:

<%

DIM CN, STRCNN

Set cn = server.createObject ("adodb.connection") set strcn = server.createObject ("adoDb.recordset")

Strcnn = "provider = microsoft.jet.Oledb.4.0; data source = f: /ASPTEST/tree.mdb; persist security info = false"

CN.Open STRCNN SET TB = Server.createObject ("adox.table") set cat = server.createObject ("adox.catalog") set cat.activeconnection = cn for each a in cat.tables response.write a.name & "
" Next Cn.close%>

转载请注明原文地址:https://www.9cbs.com/read-117323.html

New Post(0)