Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 21st, 2009, 10:25 AM
Registered User
 
Join Date: Mar 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Question Database and Javascript

I have not used javascript very much in my programs. I mostly use VB, VB.NET, VBS, ASP.NET, & ASP.

Does Javascript have the ability to access databases? I use SQL Server and MS Access 97/2000.
 
Old March 21st, 2009, 12:01 PM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

You probably need to clarify the scenario. JavaScript (or more technically JScript) running on Windows can access databases using COM and ADO. When I used to write classic ASP I nearly always used JScript as the server-side language.

However JavaScript running client-side in a browser would struggle to connect to a database because of the security limitations of the browser and accessibility of the server.
__________________
Joe
http://joe.fawcett.name/
 
Old March 21st, 2009, 12:10 PM
Friend of Wrox
 
Join Date: Sep 2005
Posts: 166
Thanks: 2
Thanked 33 Times in 33 Posts
Default

Indeed. In terms of using client side JavaScript to access a database on your public web site, yes it is technically possible, but a seriously bad and not very user-friendly idea because of the security warnings and issues as Joe says.
If you are creating an internal Intranet for example tho, you could use it if you wanted to (but I would still prefer a server based solution with Ajax or something).
Using ActiveX, so IE only, you can create ADO objects to use the same way as in ASP. There is a simple example at http://www.planet-source-code.com/vb...=2804&lngWId=2

Phil





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem in javascript in checking database value khatu_jec ASP.NET 2.0 Professional 1 August 28th, 2007 08:10 AM
access sql database using javascript vivek_inos Javascript How-To 2 October 12th, 2006 01:29 PM
Database connection with javascript rupen Javascript 5 April 20th, 2006 09:10 AM
Access Database from Javascript with rds nosreg Access 2 February 3rd, 2005 07:19 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.