How to deal with databases

Results 1 to 2 of 2

Thread: How to deal with databases

  1. #1
    Join Date
    Dec 1969

    Default How to deal with databases

    I am new to JavaScript.<BR>i need to know how to connect to a database with DSN=anything, give it an SQL statement with a variable, execute the SQL and open a recordset. my goal is to display the recordset as a table. I would really appreciate a very small example.

  2. #2
    Tom Newton Guest

    Default RE: How to deal with databases

    I use a connection string and Stored procedure in the following example. You also need to make sure that you include the following: &#060;!--#include File=""--&#062;<BR>You may need to find the location of this file on your server. It is required in order to use ado in jscript.<BR><BR>var Rs1 = Server.CreateObject("ADODB.Recordset.2.5");<BR> var Connect = "Provider=SQLOLEDB;SERVER=XENO;DATABASE=XMLEXAMPLE ;UID=BUDDY; PWD=123abc";<BR> var Source = "EXEC save_url @Description = &#039" + adddesc + "&#039, @URL = &#039" + addurl + "&#039, @Rating = &#039" + addrating + "&#039;";<BR> Rs1.Open(Source, Connect);<BR><BR>I hope this helps, I to just a month ago had this very question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts