Database connection and remote scripting

Results 1 to 2 of 2

Thread: Database connection and remote scripting

  1. #1
    Join Date
    Dec 1969

    Default Database connection and remote scripting

    i am calling the following function by remote scripting. It gives me an error but it is not specific. Can you please review the database code and tell me if you see anything wrong. It is in javascript.<BR><BR>function _ParamFunction(strvalue,strvalue2){<BR><BR>var cnTrainTrax = Server.CreateObject("ADODB.Connection");<BR> cnTrainTrax.Open("Provider=SQLOLEDB.1,Initial catalog=TrainTraxSQL,Data Source=THREEAMIGOS","vbcomponent","moosehead");<BR ><BR>var rsNewEmployeeID = Server.CreateObject("ADODB.Recordset");<BR><BR>var strSQL = "SELECT dbo.tblSecurity.EmployeeID FROM dbo.tblSecurity WHERE (dbo.tblSecurity.username = &#039;" & strvalue & "&#039;) AND (dbo.tblSecurity.Password = &#039;" & strvalue2 & "&#039;)";<BR> <BR> rsNewEmployeeID.Open(strSQL,cnTrainTrax);<BR> <BR> var EmployeeID = rsNewEmployeeID.Fields("EmployeeID");<BR><BR> return (EmployeeID);<BR>}

  2. #2 Guest

    Default What is the error?

    Please show the error message and also try displaying the sql srting you are building.<BR><BR>Response.Write(strSQL);

Posting Permissions

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