INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Accessing Access databases in JavaScript?

Accessing Access databases in JavaScript?

(OP)
I have a front end written using classic ASP. One of its elements is a select/option drop-down menu using Onchange. As such the user will scroll through a bunch of database records, no problem at all using ASP. When the Onchange fires it causes a function, a *JavaScript* function, in the header to be executed. I have no problem constructing the appropriate SQL statement in the form of
"select * where ID=value"

How do I open the desired database (XYZ.MDB, for example) and execute the constructed SQL upon it, all in JavaScript?

(Oh, the database resides on a remote server, protected by a userID/password)


RE: Accessing Access databases in JavaScript?

Short answer: not at all.
JS is executed in the browser, i.e. client-side, and has therefore no access to your server-side database.
Database calls must be done in your ASP part.

Intermediate answer: Take a look at this:
http://stackoverflow.com/questions/1629569/depende...

Long answer: does it have to be _classic_ ASP?
You might want to look into ASP.Net, maybe even MVC, use AJAX, and live a safer, less stressful life.

"Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family." (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.

RE: Accessing Access databases in JavaScript?

P.S: Seeing as this is about an Access database and classic ASP rather than SQL Server, you better post it here instead:
forum333: Microsoft: ASP (Active Server Pages)

"Knowledge is power. Information is liberating. Education is the premise of progress, in every society, in every family." (Kofi Annan)
Oppose SOPA, PIPA, ACTA; measures to curb freedom of information under whatever name whatsoever.

RE: Accessing Access databases in JavaScript?

This is clearly the wrong forum for this question.

However, from past experience, I know it is possible. You can use javascript with ajax on the client side to access particular pages on the server. Based on parameters passed to the server page (which can be classic ASP), it would return a result to your ajax call on the client side.

-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close