You must Sign In to post a response.

how to connect javascript to an SQL database

Hi all,
how to connect javascript to an SQL database


Author: Deepa10 Jul 2008 Member Level: Gold   Points : 6

Here is the simplest example to get you started. You just need to change the ODBC connection and table information to match yours.

<%@ LANGUAGE = VBScript %>
<% Option Explicit %>

Dim oConnection, oRecordset
Set oConnection = Server.CreateObject("ADODB.Connection")
oConnection.Open "IntranetSQL"
Set oRecordset = oConnection.Execute("SELECT * FROM Employees")

Response.write(activewidgets_grid("obj", oRecordset))

'Alternate method via recordset
'do while not oRecordset.eof
'str = str & oRecordset("FirstName") & "," & oRecordset("LastName") & vbCrlf

Set oRecordset = nothing
Set oConnection = nothing

Author: Nithya10 Jul 2008 Member Level: Gold   Points : 6


here i have given the example program for accessing database...

Entitled Document

Author: sathiya10 Jul 2008 Member Level: Silver   Points : 6

HI in the following code i connected javascript with ms-access database.U modify it sql database

<%@ Import Namespace="System.Data.OleDb" %>