How to create & use ADO objects using JavaScript

Results 1 to 2 of 2

Thread: How to create & use ADO objects using JavaScript

  1. #1
    vijay Guest

    Default How to create & use ADO objects using JavaScript

    hi all,<BR>i intend to convert all my server-side scripting from VBScript to JScript/JavaScript<BR><BR>The only problem i am facing is how to write following code in JavaScript<BR><BR>Set cn=Server.CreateObject("ADODB.Connection")<BR><BR> "some code"<BR> &#124<BR> &#124<BR>set rs = cn.execute<BR><BR>etc...<BR><BR>please help<BR>

  2. #2
    Join Date
    Dec 1969

    Default Sample with JavaScript - calling stored procedure

    function Main()<BR>{ <BR> //Create the Connection object and open <BR> var loConn = Server.CreateObject("ADODB.Connection");<BR> loConn.ConnectionString = "provider=msdaora;Data Source=InstanceName;User ID=MyClient;Password=MyPassword";<BR> loConn.CursorLocation = adUseClient;<BR> loConn.Open();<BR> <BR> //Create the Command object and associate it with the Connection object<BR> var loCmd= Server.CreateObject("ADODB.Command");<BR> loCmdActiveConnection = loConn;<BR><BR><BR> lsSQL = "{Call H_ZIP_CD_P.GET_ZIP_CITIES(?,?,{Resultset 99999,zip_tbl,city_tbl})}"<BR> <BR>// create command<BR> loCmd.CommandText = lsSQL;<BR> loCmd.CommandType = adCmdText;<BR><BR> loCmd.Parameters.Append(loCmd.CreateParameter("sta rt_zip_cd",adVarChar, adParamInput,3,"750"));<BR> loCmd.Parameters.Append(loCmd.CreateParameter("end _zip_cd",adVarChar, adParamInput,3,"780"));<BR><BR>// create recordset<BR> var loRS = Server.CreateObject("ADODB.RecordSet"); <BR> loRS = loCmd.Execute();<BR><BR>%&#062;

Posting Permissions

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