Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 11th, 2003, 03:24 PM
Authorized User
 
Join Date: Jun 2003
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default debugging asp/javascript

I can't figure out why there is an internal error for this code below, i don't see the problem, do you?

<%@ LANGUAGE = JavaScript%>
<HTML>
<HEAD>
</HEAD>
<BODY>
<%
   // Array to hold names of months
   // used for creating date in format day month year
   var month = new Array("Jan","Feb","Mar","Apr","May","Jun","Jul",
      "Aug","Sep","Oct","Nov","Dec");
   var nowDate = new Date();
   var nowDate = nowDate.getDate() + " " + month[nowDate.getMonth()] + " " +
      nowDate.getFullYear();
   var orderNo;

   // Connect to database
   var adoConnection = Server.CreateObject("ADODB.Connection");
   adoConnection.Open("DSN=conhcn");
   var adoRecordset;

   // Create SQL to insert new order into CustomerOrder table
   var mySQL = "INSERT INTO clientprojects " +
      "(email, description, datePosted )";
   mySQL = mySQL + " VALUES ('" + Request.Form("email") + "','";
   mySQL = mySQL + Request.Form("description") + "','";
   mySQL = mySQL + nowDate + "')";

   // Execute SQL to add new order
   adoConnection.Execute(mySQL);


   // Recordset not needed after this so close it and allow release of memory
   adoRecordset.Close();
   adoRecordset = null;



   // No more database access
   // so close connection and indicate memory no longer needed
   adoConnection.Close();
   adoConnection = null;

   Response.Write("<H2><CENTER>Your order was completed successfully" +
      "</CENTER></H2>");
%>
</BODY>
</HTML>
 
Old October 22nd, 2003, 04:42 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

hello katie
Why you are using javascript? use vbscript this is very simple way. try it
if u want to use javascript i will help u.
check this method and do it.it will work.
first u create a page (name :global.asa ---- not asp use asa)
'''''''''''''''''''''global.asa code ''''''''''''''''''''''''''''''
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
Sub Application_OnStart
        Application("Con_ConnectionString") = "DSN=conhcn;DBQ=c:\database\databasename.mdb;Drive rId=281;FIL=MS Access;MaxBufferSize=2048;PageTimeout=5;"
        Application("Con_ConnectionTimeout") = 15
        Application("Con_CommandTimeout") = 30
        Application("Con_CursorLocation") = 3
        Application("Con_RuntimeUserName") = ""
        Application("Con_RuntimePassword") = ""
End Sub
</SCRIPT>
'''''''''''''''''''''''''''''''''''''''''''''''''' '''''''''
<HTML>
<HEAD>
</HEAD>
<BODY>
<%
nowDate=date()
    set cnn=Server.CreateObject("ADODB.Connection")
    cnn.Open Application("Con_ConnectionString")
sql="Insert into clientprojects (email, description, datePosted) values ('"& Request("email") &"','"& Request("description") &"','"& nowDate &"')"
cnn.Execute sql

%>

<H2><CENTER>Your order was completed successfully</CENTER></H2>
</BODY>
</HTML>

surendran





Similar Threads
Thread Thread Starter Forum Replies Last Post
debugging activex dll's from asp problem Classic ASP Basics 0 March 28th, 2006 01:19 PM
Problems with debugging ASp.net ocabrera70 ASP.NET 2.0 Basics 1 March 1st, 2006 03:49 PM
Debugging ASP.NEt with C# braheem C# 3 June 24th, 2005 11:44 AM
Debugging ASP application sureshkamma20 Classic ASP Professional 2 June 18th, 2004 01:20 PM
Debugging ASP alyeng2000 Classic ASP Components 1 October 15th, 2003 10:14 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.