Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
2.0 KiB

  1. <%@Language=Javascript%>
  2. <%
  3. Response.Buffer = true
  4. %>
  5. <!-- #Include File="Global_DBUtils.asp" -->
  6. <%
  7. Response.Clear()
  8. Response.Buffer = false
  9. //Response.ContentType="text/xml"
  10. Response.CacheControl="no-cache"
  11. Response.addHeader( "Pragma", "no-cache" )
  12. Response.Expires=-1
  13. var Index=0
  14. var Params = new Array()
  15. var RedirectURL = new String( Request.QueryString( "RedirectURL" ) )
  16. var DBToConnectTo = Request.QueryString("DBConn")
  17. var StoredProc = new String( Request.QueryString("SP") )
  18. var Param1 = Request.QueryString( "Param3" )
  19. //Response.Write("Param1: " + Param1 + "<br><br>" )
  20. for ( var i=0 ; i < 10 ; i++ )
  21. {
  22. var P = "Param" + i
  23. if ( String(Request.QueryString( P )) != "undefined" )
  24. Params[i] = new String( Request.QueryString( P ) )
  25. else
  26. break
  27. //Response.Write("P: " + P + " Param: " + i + "<BR>" )
  28. }
  29. var DBExecString = StoredProc + " "
  30. for ( var i=0 ; i< Params.length ; i++ )
  31. {
  32. var P = new String( Params[i] )
  33. P = P.replace( /'/g, "''" )
  34. if ( i == (Params.length-1) )
  35. DBExecString = DBExecString + "'" + P + "'"
  36. //DBExecString = DBExecString + "'" + Params[i] + "'"
  37. else
  38. DBExecString = DBExecString + "'" + P + "',"
  39. }
  40. //try
  41. {
  42. //open up the test case database.
  43. g_DBConn = GetDBConnection( Application( DBToConnectTo) )
  44. //Response.Write( DBExecString )
  45. var rsRecordSet = g_DBConn.Execute( DBExecString )
  46. if ( RedirectURL != "undefined" )
  47. {
  48. Response.Redirect( RedirectURL )
  49. }
  50. else
  51. {
  52. //1 = adPersistXML
  53. rsRecordSet.Save(Response, 1 )
  54. }
  55. }
  56. /*
  57. catch( err )
  58. {
  59. if ( String( Request.QueryString("debug")) != "undefined" )
  60. {
  61. Response.Write("Could not execute stored procedure: " + StoredProc + "<BR>" )
  62. Response.Write( DBExecString + "<BR>" )
  63. Response.Write( "Description: " + err.description )
  64. }
  65. }
  66. */
  67. //if( Request.QueryString("Debug") != "" )
  68. //{
  69. //Response.Write("Done");
  70. //}
  71. g_DBConn.Close()
  72. %>