"fad" <fa********@mail.codecomments.com> wrote in message
news:fa********@mail.codecomments.com...
Thanks for you Aaron
but this code works with VBSCRIPT and I don't Know how to convert it to
javascript>>>I want it with javascript not with VBSCRIPT
--
fad
It's on the server so does it really matter?
Code it as a function, credit the source, and be done with it.
<%
if AccessTableExists( "/file.mdb", "foo") then
response.write("Table exists.")
else
response.write("Table does not exist.")
end if
Function AccessTableExists( dbname, tableToFind )
'****
'* How do I determine if a table exists in an Access database?
'*
http://www.aspfaq.com/show.asp?id=2350
'****
AccessTableExists = False
ConnStr = "Provider=Microsoft.Jet.OLEDB.4.0;data source="
ConnStr = ConnStr & server.mappath(dbname)
set adoxConn = CreateObject("ADOX.Catalog")
set adodbConn = CreateObject("ADODB.Connection")
adodbConn.open ConnStr
adoxConn.activeConnection = adodbConn
found = false
for each table in adoxConn.tables
if lcase(table.name) = lcase(tableToFind) then
found = true
exit for
end if
next
adodbConn.close: set adodbConn = nothing
set adoxConn = nothing
if found then AccessTableExists = True
End Function
%>