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


Comments

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
'movenext
'loop

oRecordset.close
Set oRecordset = nothing
oConnection.close
Set oConnection = nothing
%>




http://www.activewidgets.com/javascript.forum.262.11/how-to-connect-to-sql.html

http://www.activewidgets.com/javascript.forum.263.1/how-to-connect-to-sql.html

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

hi...

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" %>






















CompanynameContactnameAddressCity
<%#Container.DataItem("companyname")%><%#Container.DataItem("contactname")%><%#Container.DataItem("address")%><%#Container.DataItem("city")%>