473,583 Members | 3,072 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Accessing SQL Server database from Javascript

Is it possible to access an SQL Server database from a Javascript client? I
know you can transfer variables from middleware to Javascript client, but
was wondering if you can directly access database from client?

Thanks for any response.

Scott
Jul 20 '05 #1
3 2714
"Scott Castillo" <sc*****@cox.ne t> wrote in message
news:z0SWb.4031 0$P17.11527@fed 1read03...
Is it possible to access an SQL Server database from a Javascript
client? I know you can transfer variables from middleware to
Javascript client, but was wondering if you can directly access
database from client?


Javascript as a language has no knowledge of or interest in databases.
Javascript is used in order to script an object model and any facilities
for database access and the like would have to be provided by the object
model being scripted. Common browser object models do not include a
mechanisms for accessing databases. There are mechanisms that can be
used but most would come under your category of "Middleware ". But it is
questionable whether it would be a good idea for database access to be
initialised with javascript as there is little that can be done to
prevent access to the source code, and any reader of the source code may
gain access to enough information to take advantage of, or deliberately
damage, the database.

Richard.
Jul 20 '05 #2
Thanks for the reply.

I was thinking that in a very simple scenario, the security could perhaps be
taken care of somehow with a little thought. But seeing as how its not
possible, I'll stop thinking about it.
"Richard Cornford" <Ri*****@litote s.demon.co.uk> wrote in message
news:c0******** ***********@new s.demon.co.uk.. .
"Scott Castillo" <sc*****@cox.ne t> wrote in message
news:z0SWb.4031 0$P17.11527@fed 1read03...
Is it possible to access an SQL Server database from a Javascript
client? I know you can transfer variables from middleware to
Javascript client, but was wondering if you can directly access
database from client?


Javascript as a language has no knowledge of or interest in databases.
Javascript is used in order to script an object model and any facilities
for database access and the like would have to be provided by the object
model being scripted. Common browser object models do not include a
mechanisms for accessing databases. There are mechanisms that can be
used but most would come under your category of "Middleware ". But it is
questionable whether it would be a good idea for database access to be
initialised with javascript as there is little that can be done to
prevent access to the source code, and any reader of the source code may
gain access to enough information to take advantage of, or deliberately
damage, the database.

Richard.

Jul 20 '05 #3
> Is it possible to access an SQL Server database from a Javascript client? I
know you can transfer variables from middleware to Javascript client, but
was wondering if you can directly access database from client?


It is nuts to allow access to a database from Any client. Certifiably
insane. Not smart.
Jul 20 '05 #4

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

Similar topics

6
2301
by: J. J. Cale | last post by:
I want to access the DOM. Can something like this be done with PHP or a combination of PHP/JAVASCRIPT? not tested! <html><head><title>DOM test</title> <?php $inFileName = 'test.js'; $outFileName = 'jk.js'; function doIt() { $dd = getElementById('first'); $dd.innerText=$outFileName; }
2
1490
by: mir nazim | last post by:
hello, i am writing an application and need to access mysql od sqllite from javascript. is it possible to access mysql/sqllite (or any free lightweight relational databse) directly from javascript. any help is appreciated. thanks
3
4309
by: prodirect | last post by:
Hi all, I hope someone can help me. I've recently created a database and wanted to put it up on an ftp sight so that multiple people could access the same tables at the same time from different geographical locations. I have been completely unsucessful in acheiving this goal so far however. Things I have tried: Create a shortcut to ftp...
5
14742
by: Vinod Kumar | last post by:
Hi All, Can I access a Javascript function written in an ASP.NET from the codebehind (C#) of that page? If yes, kindly give the code snippet to do this. Thanks and Regards Vinod Kumar
0
12065
by: sonu | last post by:
I have following client side code which i have used in my asp.net project SummaryFeatured Resources from the IBM Business Values Solution Center WHITEPAPER : CRM Done Right Improve the likelihood of CRM success from less than 20 percent to 60 percent. WHITEPAPER :
7
3800
by: Chuck Anderson | last post by:
I'm pretty much a JavaScript novice. I'm good at learning by example and changing those examples to suit my needs. That said .... ..... I have some select fields in a form I created for a database search that I am unable to figure out how to access. (The search is implemented in Php/MySQL.) The user enters search values for: name,...
5
3651
by: Navodit | last post by:
I have 3 dropdowns in my application. Based on the selections made in the first two dropdowns, I need to pull out data from the database to set up the corresponding menu for the third dropdown. How can I connect to the database on the server after the first two dropdowns have been selected by the user in order to be able to set up the third...
4
4208
by: Noy B | last post by:
Hi, I have developed a small application that is using a MSAccess DB. the problem is that it was developed on a machine where the application and the DB are both located. now it needs to be change that the application will be able to run on any other machine (using \\ syntax on the run command- not a problem) using the DB located on a...
0
7895
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7826
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8182
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8327
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7935
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8193
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
3818
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3843
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1157
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.