Javascript and ADO

Results 1 to 2 of 2

Thread: Javascript and ADO

  1. #1
    Join Date
    Dec 1969

    Default Javascript and ADO

    I am running ASP code that pulls data from an Access DB using<BR>vbscript. This works fine.<BR><BR>I have a need to pull more data from the DB within Javascript.<BR><BR>I have a small Select statement below that is giving a<BR>compilation error on the set results line. <BR>I tried putting it in parens. No good.<BR><BR>Any help would be appreciated.<BR><BR><BR>&#060;SCRIPT LANGUAGE=javascript RUNAT=Server&#062;<BR> var mySQL;<BR>var results; <BR> var RS1 = Server.CreateObject("ADODB.RECORDSET")<BR> <BR> ("DRIVER={Microsoft Access Driver (*.mdb)};DBQ=d:\wwwroot\test2prod\eus_support.mdb" );<BR> mySQL = "Select bname,bcode,mgrcode from building "; <BR><BR>set results = RS1.execute(mySQL);<BR><BR>results.movefirst<BR> <BR> alert(results(0));<BR>//alert(results); <BR> &#060;/SCRIPT&#062;

  2. #2
    Join Date
    Dec 1969

    Default RE: Javascript and ADO

    you don&#039;t use SET in javascript. use var<BR><BR>(i.e. it&#039;s not the query, it&#039;s the javascript)<BR><BR>j<BR><BR>

Posting Permissions

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