You can use ADOX to determine whether an Access Table exists.

Source: Internet
Author: User

Haha, no need to use ADOX !!
 

<%

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 ;"
Strcnn = strcnn & "Persist Security info = false"

CN. Open strcnn
 
Set rstschema = cn. openschema (20)
Rstschema. movefirst
Do until rstschema. EOF
If rstschema ("table_type") = "table" then
Response. Write rstschema ("table_name") & "<br/>"
End if
Rstschema. movenext
Loop
CN. Close

'Set rstschema = nothing
'Set Cn = nothing
%>

SQL --> system table sysobjects

Example of using ADOX in access:

<%

Dim CN, strcnn

Set Cn = server. Createobject ("ADODB. Connection ")
Set strcnn = 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 & "<br>"
Next
 
CN. Close
%>
 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.