none
How to send form to database and to email?

    Question

  • I have an .asp form I created a while ago in FP which when submitted populates a backend Access DB.  I would ultimately like to have the same data that is sent to the DB also be sent to me via email whenever anyone fills out and submits the form.  However, I would settle for simply an email notification that a form has been submitted so then I could go view the record. 

    I am now using Expressions Web and have created a number of .aspx pages now to dynamcially render the data that is in this database.

    I am following a number of threads here and links to external sites and tutorials regarding sending forms to either a DB or to email but don't see anything that explains how to send to both at the same time.

    Can anyone please point me in the direction of how to edit my .asp form page that sends to my Access DB to also send an email?

    Windows Server 2003
    IIS6
    Expressions Web2
    .NET Framework
    Tuesday, April 14, 2009 11:11 PM

Answers

  • What you are referring to earlier is exactly what I have been saying from the beginning

    "I have an .asp form I created a while ago in FP which when submitted populates a backend Access DB.  I would ultimately like to have the same data that is sent to the DB also be sent to me via email whenever anyone fills out and submits the form.  However, I would settle for simply an email notification that a form has been submitted so then I could go view the record.  I am now using Expressions Web and have created a number of .aspx pages now to dynamcially render the data that is in this database."


    The help I have been searching for was how to send the existing form page to the database as it does presently successfully and to email at the same time.  I even stated that I would be happy if it could not send the same information via email to at least send me a ping that a form had been submitted.

    The general concensus has been "rebuild the form", use "CRUD", etc.  Well... I am happy to say that I have successfully added the ability to send an email ping using CDONTS besides entering the form data into the DB without rebuilding the .asp form and without using CRUD, infact without using any thing from this post.  Data is successfully entered to the database via the webform and I get an email ping that a new record was created.  The records can be updated using the .aspx pages I mentioned earlier in this post that I created using EW

    By the way... I am curious how you would note that the time spent talking about it so far the rebuild could have been completed.  You haven't even seen the form! 

    • Marked as answer by fingersj Saturday, May 02, 2009 4:50 PM
    Saturday, May 02, 2009 4:50 PM

All replies


  • I have an .asp form I created ...

    ... have created a number of .aspx pages ...

    ... how to edit my .asp form page ...

    OK, which is it?

    ASP <> ASP.NET. One is managed code and the other is not; they don't use the same languages, nor the same data access methods, etc. Please use terminology consistent with what your site actually uses. It really does make a difference, and using ambiguous references confuses what it is that you're actually after.

    cheers,
    scott
    Tuesday, April 14, 2009 11:36 PM
  • Hi Scott

    Sorry, I am not clear how I am being ambiguous.  The form page itself (created some time ago in FP as I mentioned) which sends to the database is default.asp.  Using Expressions Web I created the following pages to display the data in the database:
    GridViewSelectLaunch.aspx
    ListView.aspx
    RecordView.aspx
    Results.aspx


    Thanks
    Wednesday, April 15, 2009 3:14 PM
  • OK Since you have and are using asp.net my suggestion would be to first, replace your form with an an .aspx form that sents the data to your database. That way you can use the validators of Expression to ensure validity of the data being submitted to your database.

    To accomplish this, you can view the tutorials associated with my signature below.  Then, you will also find in the tutorials a link to Jim Chesire's tutorial which supplies the code needed to also send you an email via the form.
    QVP, HomePage Doctor CHO, http://www.homepagedoctor.com/Tutorials.htm
    Thursday, April 16, 2009 12:28 PM
  • Thanks Clark

    My Default.asp form already has validation from FP.  If I rename the file from .asp to .aspx it no longer opens and throws a Compilation error.  Are you suggesting to rebuild the form completely?   I hope not as the form is not a simple form.  I am hoping that I can simply use the existing form to populate the data in the database and the .aspx pages (as I have) to dynamically display the data and simply insert some code to the .asp form to either send all the data not only to the DB as it does now but also to send to email or at least send a tickler email stating that there is a new record.
    Thursday, April 16, 2009 2:45 PM
  • Hi Clark, are you suggesting rebuilding the form completely?

    Thanks
    Tuesday, April 21, 2009 5:44 PM
  • Thanks Clark

    My Default.asp form already has validation from FP.  If I rename the file from .asp to .aspx it no longer opens and throws a Compilation error.  Are you suggesting to rebuild the form completely?   I hope not as the form is not a simple form.  I am hoping that I can simply use the existing form to populate the data in the database and the .aspx pages (as I have) to dynamically display the data and simply insert some code to the .asp form to either send all the data not only to the DB as it does now but also to send to email or at least send a tickler email stating that there is a new record.
    Here is the situation. As I tried to explain above, ASP and  ASP.NET are NOT the same thing. ASP uses VBScript; ASP.NET uses VB.NET or C#. ASP.NET has a different data access model, with a complete set of data access classes that are not accessible from VBScript. Renaming a file coded in ASP, using VBScript, to an aspx extension accomplishes nothing except to confuse the compiler, which finds absolutely nothing that it recognizes. Furthermore, the Cassini development server in EW does not support ASP. It will run only ASP.NET and PHP active server technologies.

    What you can do, and what you said you were doing in your post of the 15th in which you averred that you weren't really being ambiguous, is create ASP.NET pages for CRUD on the database itself, independently from the form, which will continue to use the existing ASP coding. The ASP form page itself will not have any ASP Intellisense support in EW, and as I said, cannot be run from EW. If you want to alter that page and test it, you will have to set up another server—IIS or Apache—that supports Classic ASP, and recode the form by hand without the assistance of the EW interface or Help system.

    Your other option is to rebuild the form in ASP.NET, in which case Intellisense and Help support will be available in EW, as well as execution support from the development server, along with the extensive tutorial set provided by Clark, Jim Cheshire, Microsoft, and others. Your option...

    cheers,
    scott
    Tuesday, April 21, 2009 6:15 PM
  • Hi Clark, are you suggesting rebuilding the form completely?

    Thanks
    Yes.

    QVP, HomePage Doctor CHO, http://www.homepagedoctor.com/Tutorials.htm
    Wednesday, April 22, 2009 11:44 AM
  • Wow... I didn't realize this was going to be so difficult.  I do appoligize if I am ruffling some feathers here, that certainly is not my intention.  I also did not say that I "wasn't really being ambiguous"  I said, "Sorry, I am not clear how I am being ambiguous".  Which is true.  I wan't trying to be ambiguous.  So, if it is still possible, I have a few more questons.

    1.  I see that Clark answered yes to my question of rebuilding the form completely.  Is there any way to salvage any parts of the existing form?  I mentioned that the form is not a simple form.  It is large and very detailed.
    2.  What is CRUD?

    Thanks

    Wednesday, April 29, 2009 4:39 PM
  • It refers to the activities that one engages in with a data store—Create, Retrieve, Update, and Delete. What I was referring to earlier was the possibility of continuing to use the same ASP form to create the records in the db, but using an ASP.NET-written app to access them and process and report on them. That should work, but you would not have the ability to edit the ASP form in EW, at least not with Intellisense or server support for running the form from the IDE, so if you wish to actually alter the form itself you would have to do so without any programming aids and with an external server, IIS or Apache, set up to test the pages with.

    As to rebuilding the form, it is probably worth noting that in the time spent talking about it so far the rebuild could have been completed. Just sayin'...

    cheers,
    scott
    Wednesday, April 29, 2009 6:21 PM
  • Another suggestion is to just use an HTML Form and Formmail.php. The site below has example forms, the php code and a very easy guide to set up a working form. It also has error monitoring so if someone gets an error you get a copy. I just started using it and have not implemented validation yet but it is the easiest method I have found thus far. You can also hide your email address (i suggest just using the AT_Mangle method) and it also integrates well with Captcha. Additionally, it has a DB integration module.
    http://www.tectite.com/
    Hope this helps,
    Sam
    Wednesday, April 29, 2009 6:23 PM
  • What you are referring to earlier is exactly what I have been saying from the beginning

    "I have an .asp form I created a while ago in FP which when submitted populates a backend Access DB.  I would ultimately like to have the same data that is sent to the DB also be sent to me via email whenever anyone fills out and submits the form.  However, I would settle for simply an email notification that a form has been submitted so then I could go view the record.  I am now using Expressions Web and have created a number of .aspx pages now to dynamcially render the data that is in this database."


    The help I have been searching for was how to send the existing form page to the database as it does presently successfully and to email at the same time.  I even stated that I would be happy if it could not send the same information via email to at least send me a ping that a form had been submitted.

    The general concensus has been "rebuild the form", use "CRUD", etc.  Well... I am happy to say that I have successfully added the ability to send an email ping using CDONTS besides entering the form data into the DB without rebuilding the .asp form and without using CRUD, infact without using any thing from this post.  Data is successfully entered to the database via the webform and I get an email ping that a new record was created.  The records can be updated using the .aspx pages I mentioned earlier in this post that I created using EW

    By the way... I am curious how you would note that the time spent talking about it so far the rebuild could have been completed.  You haven't even seen the form! 

    • Marked as answer by fingersj Saturday, May 02, 2009 4:50 PM
    Saturday, May 02, 2009 4:50 PM
  • I am glad you got things working and hope it all stays working satisfactorily for you.

    My primary reason for suggesting a re-build is the server-side validation that you can use with asp.net.  Just using Frontpage client-side validators to ensure certain kinds of data format are entered in the text fields of the form will not stop spammers from putting junk  into your database.

    Whenever you are letting user's form-entered information into your database, you really want to have good control over it, and the only "secure" control is server-side validation.
    QVP, HomePage Doctor CHO, http://www.homepagedoctor.com/Tutorials.htm
    Sunday, May 03, 2009 1:11 AM
  • I am terribly glad that you are so happy with yourself. However, since at least part of your remarks appear to be directed at me, permit me to reply.

    I am the only one to have mentioned CRUD, and if you read my reply (beyond the point necessary to make snide remarks about it), then you know that you don't "use CRUD." CRUD is simply an acronym for the activities that are the only raison d'être for a datastore—Creation, Retrieval, Updating, and Deletion. Here's a clue: It doesn't make a damned bit of difference what database you use, or what programming language, or what front end, if you use a database at all, even if only to retrieve records for display, and even if you don't ____ know that you are doing it, you engage in one of those activities. That means, in your somewhat limited understanding, that you are "using CRUD."

    Now, permit me to quote myself, if you will:

    "What I was referring to earlier was the possibility of continuing to use the same ASP form to create the records in the db, but using an ASP.NET-written app to access them and process and report on them."

    Now, unless I misunderstand what you said in your message, this is pretty much precisely what you are ____ doing, no? If you look back, you cannot help but note that I was fairly optimistic about that possibility, so

    "That should work, but you would not have the ability to edit the ASP form in EW, at least not with Intellisense or server support for running the form from the IDE, so if you wish to actually alter the form itself you would have to do so without any programming aids and with an external server, IIS or Apache, set up to test the pages with."

    And that remains a fact. You currently have your existing form pinging you when it is submitted. Wow, what an accomplishment! I am so glad that you're happy with that. I hope that you do not find it necessary to add a field to your submission, because then you would be fucked, unless you can edit ASP code without Intellisense, server execution support, or any other help.

    It's a good thing that you took the time to acknowledge the folks who took the time to try to help you. Should go a long way toward prioritizing your future requests for help in the forum.

    cheers,
    scott
    Sunday, May 03, 2009 6:39 AM