473,473 Members | 1,899 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

table exists???(asp+javascript)

fad

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
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Jul 22 '05 #1
2 2182
"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
%>
Jul 22 '05 #2
If you're comfortable with server-side JavaScript, then it should be
absolutely trivial to convert it. If not, then why are you doing it?
Anyway, the article is what I offer, take it or leave it.

--
This is my signature. It is a general reminder.
Please post DDL, sample data and desired results.
See http://www.aspfaq.com/5006 for info.


"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
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: John Davis | last post by:
When I create new documents in Dreamweaver, there are several choices for ASP creation: ASP JavaScript: run at client side?? ASP VBScript: run at server side?? ASP.NET C# ASP.NET VB I don't...
2
by: fad | last post by:
How can I create a database access using asp+javascript withen the code?Is there (createdatabase)?If yes how can we use it? thanks for all -- fad...
1
by: fad | last post by:
How can I check if a table exists in an access database using (asp with javascript) Thanks for you all -- fad ------------------------------------------------------------------------...
5
by: aabluedragon | last post by:
hi, im learning asp javascript in my class and i want to improve my skill. anyone has a good website which you suggest? Thanks.
0
by: GirishKumar | last post by:
Am interested to know any available parsers for ASP / JavaScript / VBScript... OR any site info giving grammar of these... -- Girish Kumar Satyam
7
by: Bruno Alexandre | last post by:
Hi guys, Sorry about the off topic, but I can't find the ASP group just the ASP dot NET If I want to block a user to change a form after submiting, I add a function that will disable the...
17
by: kartheek | last post by:
hi friends, can any one out here help me by giving me the code to connect to an MSACCESS database using javascript.
1
by: davemcdonald | last post by:
ASP Javascript (Dreamweaver) insert and retreive Primary Key -------------------------------------------------------------------------------- Been pulling my hair out all week. I am working on...
5
by: loveshack | last post by:
Can anyone help me please (i am quite a novice, but having fun learning). Im not sure if this is an ASP problem, a javascript problem or a browser problem. Firstly, everything i have written...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.