Connecting Tech Pros Worldwide Help | Site Map

Accessing SQL Server database from Javascript

  #1  
Old July 20th, 2005, 03:29 PM
Scott Castillo
Guest
 
Posts: n/a
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


  #2  
Old July 20th, 2005, 03:29 PM
Richard Cornford
Guest
 
Posts: n/a

re: Accessing SQL Server database from Javascript


"Scott Castillo" <scasti2@cox.net> wrote in message
news:z0SWb.40310$P17.11527@fed1read03...[color=blue]
>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?[/color]

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.


  #3  
Old July 20th, 2005, 03:29 PM
Scott Castillo
Guest
 
Posts: n/a

re: Accessing SQL Server database from Javascript


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" <Richard@litotes.demon.co.uk> wrote in message
news:c0gs32$klr$1$8302bc10@news.demon.co.uk...[color=blue]
> "Scott Castillo" <scasti2@cox.net> wrote in message
> news:z0SWb.40310$P17.11527@fed1read03...[color=green]
> >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?[/color]
>
> 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.
>
>[/color]


  #4  
Old July 20th, 2005, 03:29 PM
Douglas Crockford
Guest
 
Posts: n/a

re: Accessing SQL Server database from Javascript


> Is it possible to access an SQL Server database from a Javascript client? I[color=blue]
> know you can transfer variables from middleware to Javascript client, but
> was wondering if you can directly access database from client?[/color]

It is nuts to allow access to a database from Any client. Certifiably
insane. Not smart.
Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date in database fniles answers 30 January 11th, 2008 12:55 AM
Forum without sql-server? Joni Nieminen answers 13 June 28th, 2006 06:42 AM
Intergrating SQL Server Reporting Services into an ASP.NET app Brendan Reynolds answers 8 November 19th, 2005 06:02 PM
Javascript Vs Perl RegExp phal answers 3 September 23rd, 2005 07:05 PM