JScript connectivity

Results 1 to 2 of 2

Thread: JScript connectivity

  1. #1
    Join Date
    Dec 1969

    Default JScript connectivity

    How can we use JScript to connect to a database.<BR>I get books for VBScript only

  2. #2
    Join Date
    Dec 1969

    Default Same as VBScript...

    Excepting only that you can&#039;t omit arguments with JS except at the end of the list of arguments. <BR><BR>&#060;%<BR>var conn = Server.CreateObject("ADODB.Connection")<BR>conn.op en( "dsn=somedb" ); // or use DSN-less connection<BR><BR>var RS = conn.Execute("SELECT * FROM sometable WHERE theUser=&#039;" + Request("userName") + "&#039;");<BR>while ( ! RS.eof )<BR>{<BR> Response.Write( RS("whatever") + "&#060;br/&#062;
    " );<BR> RS.MoveNext;<BR>}<BR>RS.close();<BR>conn.close();< BR>%&#062;<BR><BR>See? No real difference. Just minor differences in syntax. But if you are used to coding in JS, then you should be used to that syntax.<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