Writing the server.CreateObject("ADODB.Connection") in JavaScript

Results 1 to 2 of 2

Thread: Writing the server.CreateObject("ADODB.Connection") in JavaScript

  1. #1
    Join Date
    Dec 1969
    Posts
    35

    Default Writing the server.CreateObject("ADODB.Connection") in JavaScript

    I am a big fan of JavaScript whose having a little difficulty transfering over to VBScript. All of the ASP tutorials that I&#039ve read have said that ASP Scripts can be written in JavaScript, but with a few very linited exceptions, there is absolutly no information what so ever about how to do even basic things like this using JavaScript. At any rate If anyone knows how to write this and the related lines about opening, closing and writing to a DB in JaaScript I&#039d appreciate it.

  2. #2
    Join Date
    Dec 1969
    Posts
    2,849

    Default RE: Writing the server.CreateObject(

    It&#039s not too difficult. It&#039s just like VBScript with a flare of JavaScript syntax! :)<BR><BR>First, you will need to specify that you want to use JScript:<BR><BR>&#060;% @LANGUAGE="JSCRIPT" &#037;&#062;<BR><BR>should be at the top of your ASP pages. Here is an example of creating an instance of the ADODB.Connection object using JScript.<BR><BR>&#060;%<BR> var objConn;<BR> objConn = Server.CreateObject("ADODB.Connection");<BR> objConn.Open("DSN=Northwind");<BR><BR> ...<BR><BR> objConn.Close();<BR>&#037;&#062;<BR><BR>Does this answer your question? Case is important when using JScript, as well as the parens for all functions. Semicolons are optional (I think), but I always use them! Have a great day!

Posting Permissions

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