Server Side javascript

Results 1 to 2 of 2

Thread: Server Side javascript

  1. #1
    Join Date
    Dec 1969

    Default Server Side javascript

    How do I use server side javascript to connect to, update and edit a data base? Is this a simple issue?? I've used javascript only on client side so far, and I have no idea how to even begin server side java scripting.

  2. #2
    Join Date
    Dec 1969

    Default Same as with VBScript...

    There are a handful of things that are really tough to do with JScript coding. Such as ADODB.RecordSet.GetRows (which returns a 2D VBScript array, which you *can* read with JScript code, but it&#039;s a real pain and surely not worth the trouble).<BR><BR>But in general... No different that with VBS except for the minor differences in syntax between the two languages. Most any "help" page you find for ASP that uses VBScript is easily translated to JScript.<BR><BR>Example:<BR><BR>&#060;%@ LANGUAGE=VBSCRIPT %&#062;<BR>&#060;%<BR>conn = Server.CreateObject("ADODB.Connection")<BR>conn.Op en( "DSN=whatever" )<BR>Set RS = conn.Execute("SELECT * FROM table WHERE foo=7")<BR>While Not RS.EOF<BR>&nbsp; &nbsp; Response.Write RS("ID") & ": " & RS("Description") & "&lt;BR&#062;" & vbNewLine<BR>&nbsp; &nbsp; RS.MoveNext<BR>Loop<BR>%&#062;<BR><BR>************ *******<BR><BR>&#060;%@ LANGUAGE=JSCRIPT %&#062;<BR>&#060;%<BR>var conn = Server.CreateObject("ADODB.Connection");<BR>conn.O pen( "DSN=whatever" );<BR>var RS = conn.Execute("SELECT * FROM table WHERE foo=7");<BR>while ( ! RS.EOF )<BR>{<BR>&nbsp; &nbsp; Response.Write (RS("ID") + ": " + RS("Description") + "&lt;BR&#062;
    ");<BR>&nbsp; &nbsp; RS.MoveNext( );<BR>}<BR>%&#062;<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