Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." 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 Basics 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 March 29th, 2004, 09:07 PM
Authorized User
 
Join Date: Mar 2004
Location: , , .
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to gmoney060 Send a message via MSN to gmoney060
Default Database entry from HTML forms

Hello, I am very new to ASP and i am trying to learn how to take data from a HTML form and enter it into a Microsoft access database. This is what i have so far, but it is not working at all!!! HELP!

<%
       'Open DSNless connection to the banner database
        dbName = "/fpdb/magic_database.mdb"
        ObjConn= "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & Server.MapPath(dbName)

       'Used when the submit button is pressed
        strcard_name = Request.Form("card_name")
        strcard_set = Request.Form("card_set")
        strcard_color = Request.Form("card_color")
        strquantity = Request.Form("quantity")
        Recordset.Open "magic_entry", strConn, adOpenDynamic, adLockOptimistic, adCmdTableDirect
        .AddNew
          .Fields("card_name") = strcard_name
          .Fields("card_set") = strcard_set
          .Fields("card_color") = strcard_color
          .Fields("quantity") = strquantity
        .update

        End
%>

<Form name="magic_entry">
<form method="POST" action="mailing_edit40894272720.asp">
<table border="0" cellpadding="2" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="600" id="AutoNumber1">
  <tr>
    <td width="284" colspan="2">Card Name:
    <input type="text" name="card_name" size="26"></td>
  </tr>
  <tr>
    <td width="284" colspan="2">Card Set: <select size="1" name="card_set">
    <option value="darksteal">Darksteal</option>
    <option value="mirrodin">Mirrodin</option>
    <option value="8th">8th Edition</option>
    </select></td>
  </tr>
  <tr>
    <td width="284" colspan="2">Color: <select size="1" name="card_color">
    <option>White</option>
    <option>Blue</option>
    <option>Black</option>
    <option>Green</option>
    <option>Multicolor</option>
    <option>Artifact</option>
    <option>Land</option>
    <option>Red</option>
    </select></td>
  </tr>
  <tr>
    <td width="142">Quantity: <input type="text" name="quantity" size="5"></td>
    <td width="142"><input type="submit" value="Submit" name="B1">&nbsp;
    <input type="reset" value="Reset" name="B2"></td>
  </tr>
</table>

Please tell me what i did wrong, and it would be great to know as fast as i can. Because i have to have this done for my boss by friday! (YIKES)


 
Old March 30th, 2004, 04:45 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

What error do you get?

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old March 30th, 2004, 05:06 AM
Authorized User
 
Join Date: Jan 2004
Location: , , .
Posts: 45
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hello

 
Quote:
quote:ObjConn= "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=" & Server.MapPath(dbName)
Quote:

       'Used when the submit button is pressed
        strcard_name = Request.Form("card_name")
        strcard_set = Request.Form("card_set")
        strcard_color = Request.Form("card_color")
        strquantity = Request.Form("quantity")
        Recordset.Open "magic_entry", strConn, adOpenDynamic, adLockOptimistic, adCmdTableDirect
shldnt it be ObjConn instead of strConn??

 
Old March 30th, 2004, 08:07 PM
Authorized User
 
Join Date: Mar 2004
Location: , , .
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to gmoney060 Send a message via MSN to gmoney060
Default

500 internal server error


 
Old March 31st, 2004, 04:50 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Please follow the instructions in this FAQ to get more detailed error information, and then post the outcome of the detailed error message to this forum.

Didn't the solution suggested by dhaywirex fix the problem?

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.




Similar Threads
Thread Thread Starter Forum Replies Last Post
Forms or a solution for end user data entry? Scott B SQL Server 2005 0 October 19th, 2007 04:21 AM
Formatting Data Entry in forms aRtware Access 5 May 12th, 2006 09:16 AM
Searching a database for an entry sconineuk VB.NET 2002/2003 Basics 6 March 24th, 2006 12:25 AM
Database Entry Problems gmoney060 Classic ASP Databases 4 November 9th, 2004 08:19 AM
Database Double Entry isg2000 Access ASP 1 June 13th, 2003 04:30 AM





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