Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Sending Data to a Database

  1. #1
    Join Date
    Jun 2003
    Posts
    277
    Rep Power
    0

    Default Sending Data to a Database

    Can anyone tell me...

    How do you transfer data entered from a form field to a database(MSAccess)...

    What's the command after opening the Record Set ?

  2. #2
    igodit Guest

    Default Re:Sending Data to a Database

    You need to create the form, which you may have already done. But here is an example for the others that don't know.

    <form name="YourFormName" method="Post" action="resultspage.asp">
    <table>
    <tr><td>Email: </td>
    <td><input type="text" name="Email" size="50"></td></tr>
    <tr><td>Name: </td>
    <td><input type="text" name="Name" size="50"></td></tr>
    <tr><td>Comments: </td>
    <td><textarea name="Comments"></textarea></td>
    </table>

    <input type="submit" name="Submit" value="Submit Form">
    </FORM>
    Then the resultpage.asp goes like this

    ' If you don't know what this does, you shouldn't be doing this. Joke! This is the database connection.
    'Best to have it as an INCLUDE file.
    <!--#INCLUDE VIRTUAL="/includes/connection.asp" -->

    <%
    DIM objRS
    Set objRS = Server.CreateObject("ADODB.Recordset&quot
    objRS.Open "YOUR table name goes HERE", objConn, , adLockOptimistic, adCmdTable

    objRS.AddNew
    objRS("Email&quot = Request.Form("Email&quot
    objRS("Name&quot = Request.Form("Name&quot
    objRS("Comments&quot = Request.Form("Comments&quot
    objRS.Update

    objRS.Close
    Set objRS = Nothing
    objConn.Close
    Set objConn = Nothing
    %>

    <p>
    <%
    DIM strName
    strName = Request.Form("Name&quot
    Response.Write strName
    %>,</p>

    <p>Tank yuh!.</>
    Good luck!

  3. #3
    Join Date
    Aug 2002
    Posts
    612
    Rep Power
    0

    Default Re:Sending Data to a Database

    Have you consiered PHP and SQL...SQL's faster than Access

  4. #4
    Join Date
    Apr 2003
    Posts
    13,269
    Rep Power
    34

    Default Re:Sending Data to a Database

    [quote author=kknight link=board=18;threadid=1661;start=0#msg16205 date=1062204937]
    Have you consiered PHP and SQL...SQL's faster than Access
    [/quote]SQL is a language not a database. SQL stands for Structured Query LLanguage which is used to communicate to the databases.

    You probably meant MySQL which is widely used with PHP applications, mainly because it is free.
    There is also MS SQL which is microsoft's version of a high-end database. It is costly and is usually used in Windows enviroments where-as MySQL can be used on windows or unix systems.

    ;D

  5. #5
    igodit Guest

    Default Re:Sending Data to a Database

    Hey! You don't see me in the PHP forum going "Have you considered ASP instead of PHP?".

    Some like ASP some like PHP leave it at that, I don't want to see anyone else doing that here alright.

  6. #6
    Join Date
    Apr 2003
    Posts
    13,269
    Rep Power
    34

    Default Re:Sending Data to a Database

    [quote author=igodit link=board=18;threadid=1661;start=0#msg16272 date=1062250125]
    Hey! You don't see me in the PHP forum going "Have you considered ASP instead of PHP?".

    Some like ASP some like PHP leave it at that, I don't want to see anyone else doing that here alright.
    [/quote]LoL...some like windows and some like linux, but still we got the linux fan's asking the majority of users "have you tried linux instead?", even outside of the linux forum.

    But igodit, got a point. Cue wasn't complaining about anything, so no need to suggest an alternative.

  7. #7
    Join Date
    Jul 2002
    Posts
    170
    Rep Power
    0

    Default Re:Sending Data to a Database

    ;D wow

    : i agree

  8. #8
    Join Date
    Aug 2002
    Posts
    1,236
    Rep Power
    0

    Default Re:Sending Data to a Database

    Arch_Angel,
    to be fair, he only mentioned PHP. (coulda meant PHP and SQL server on windows)

    He didn't specify which platform. If I had made the suggestion, I probably would have been MUCH more specific

    remember that if I were to suggest something else it would be for good reasons.
    economic, security, stability, ease etc.... not because I prefer how <?. .?> look vs <%. .%>. Though I must say I do have a preference there.

  9. #9
    Join Date
    Aug 2002
    Posts
    1,236
    Rep Power
    0

    Default Re:Sending Data to a Database


    so while we're on the subject... have you tried zope?
    http://zope.org



  10. #10
    igodit Guest

    Default Re:Sending Data to a Database

    There they go again, not fighting out PHP and MYSQL. They are great alternatives, so if we are ever interested we will head over to the PHP section alright.

    I see PigeonFlight trying to make a zope nest here... >

Posting Permissions

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