ASP and database

Discussion in 'Databases' started by circuitnotes, Jul 4, 2008.

  1. #1
    Hi, I have a problem with posting from an asp page to a database.I have absolutely no asp experiencing, but heres the setup. I have an asp page (forms.asp) with a form that post to another page(insert.asp) whose only purpose is to email me what was in the form. However, i also want it to post the data into a database. Currently it does this [ response.Redirect(''thankyou.asp") ]. Is there a function someone can tell me about that would also post the data to a database? Thank you very much~!
     
    circuitnotes, Jul 4, 2008 IP
  2. And!

    And! Well-Known Member

    Messages:
    562
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    130
    #2
    I have a working setup that posts your form to ODBC, but does not send an email. You may be able to incorporate it in to your set up?


    <%
    Response.Buffer = true
    dim cnn,rst
    set cnn = Server.CreateObject("ADODB.Connection")
    set rst = Server.CreateObject("ADODB.RecordSet")
    cnn.Open "driver={Microsoft Access Driver (*.mdb)};;DBQ=D:\home\sites\thingy.com\htdocs\_hide\thingy.mdb;"
    sqltext = "SELECT * FROM tbl1"
    rst.Open sqltext,cnn,3,3
    rst.AddNew
    rst("t1") = Request.Form("t1")
    rst("t2") = Request.Form("t2")
    rst("t3") = Request.Form("t3")
    rst("r1") = Request.Form("r1")
    rst("st") = Request.Form("st")
    rst.update
    rst.Close
    Set rst= Nothing
    cnn.close
    Set cnn= Nothing
    %>
     
    And!, Jul 9, 2008 IP
  3. raincoder

    raincoder Peon

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You can find at codervods.com/Default.aspx?mode=default&category=Databases&days=All&currentIndex=0 some examples that might help you out.
     
    raincoder, Jul 10, 2008 IP