[Javascript] wanted-a database script

uplate at attbi.com uplate at attbi.com
Wed Apr 30 11:42:35 CDT 2003


If you're looking for a javascript to connect to an Access DB, I believe youre
out of luck. It can be done in JScript, Microsofts version of Javascript.
Why not just submit the form to an ASP page and parse the request.form object 
to build your SQL and open an ADO connection to the database?

This may or may not be helpful to you: ASP code for looping through a customers 
table.
<%

Dim SQL
Dim oConn
Dim rs

SQL = "SELECT CUSTOMER_NAME FROM CUSTOMERS WHERE ID = " & Request.Form
("MY_FORM_ELEMENT") & ";" 
    

Set oConn = Server.CreateObject("ADODB.Connection")
    
Set rs = Server.CreateObject("ADODB.Recordset")

oConn.Open MY_CONNECTION_STRING_HERE
rs.ActiveConnection = oConn
rs.Source = SQL
rs.CursorType = 0
rs.CursorLocation = 3
rs.LockType = 1
rs.Open()


Do until rs.EOF

Response.Write(rs("LAST_NAME") & "<br>")

rs.MoveNext
Loop

rs.Close
oConn.Close

%>
> I need a javascript script that will take user-entered fields from a HTML
> form and use these to build a SQL 'select' statement.  The script will
> then open and connect to my Microsoft Access table on our site and
> displaying the results set, looping throught each one starting at the 1st
> one and going until it hits EOF. 
> 
> I've searched and searched on the web for just this - a HTML form and a
> javascript script.  Nothing.  So would someone take pity on me and email
> to me the code for the HTML form and a javascript to go with it.  I can
> edit it when I get it. 
> 
> Thank you very much.
> 
> Edwin
> ak429 at chebucto.ns.ca
> 
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> https://lists.LaTech.edu/mailman/listinfo/javascript



More information about the Javascript mailing list