473,327 Members | 2,007 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Dummy ASP Problem, but no help on web?

hi all,

i've never used ASP before, but am proficient with html / css

all i want to do is add a feedback form to a site. i have the form all set up as follows:

[html]
<form method="post" action="confirm.asp">
<table class="register">
<tr>
<td class="label">Full Name:</td>
<td class="data"><input type="text" name="name" /></td>
</tr>
<tr>
<td class="label">E-mail address:</td>
<td><input type="text" name="email" /></td>
</tr>
<tr>
<td class="label">Contact Number:</td>
<td><input type="text" name="number" /></td>
</tr>
<tr>
<td class="label">Postcode</td>
<td><input type="text" name="postcode" /></td>
</tr>
</table>
<p>Further Information: </p>
<p><textarea name="comments" rows="5" cols="70">Please leave your comments here - we will respond as quickly as possible.</textarea></p>
<p> <input type="submit" name="submit" value="Submit Contact Form" />
</p>
</form>
[/html]

simple eh?

however, i can't for the life of me get this into the database using ASP!

at the start of all my ASP pages i have:

Expand|Select|Wrap|Line Numbers
  1. <%
  2. Set objConn = Server.CreateObject("ADODB.Connection")
  3. Set objRs = Server.CreateObject("ADODB.Recordset")
  4. objConn.Provider = "Microsoft.Jet.OLEDB.4.0"
  5. objConn.Open "\\localhost/isproject/group_03.mdb"
  6. %>
  7.  
but i'm TOTALLY stuck as to how to start the ASP on confirm.asp

so far i have:

Expand|Select|Wrap|Line Numbers
  1. <% 
  2. obj.RS Open "contact", obj.Conn %>
  3. <% objRS.AddNew
  4. objRS("name") = Request.Form("name")
  5. objRS("email") = Request.Form("email")
  6. objRS("number") = Request.Form("number")
  7. objRS("postcode") = Request.Form("postcode")
  8. objRS("comments") = Request.Form("comments")
  9. objRS("datecontacted") = Date()
  10. objRS.Update
  11. %>
  12.  
but it doesn't like the first line at all - what am i doing wrong here?

all the things i've seen on the web talk about defining DSNs and connections and so forth... i don't want any of that, i just want to connect to the database and add some records!

i should add - i have the database table "contact" set up already with the fields.... i just can't seem to enter data into it

can anyone help ??

Cheers
McChristie
Feb 20 '07 #1
3 1387
jhardman
3,406 Expert 2GB
hi all,

...

Expand|Select|Wrap|Line Numbers
  1. <% 
  2. obj.RS Open "contact", obj.Conn %>
  3.  
  4. %>
  5.  
...
don't you mean:
Expand|Select|Wrap|Line Numbers
  1. <%
  2. objRS.Open "contact", objConn %>
  3.  
anyway, you can open the db to read but not write? please confirm.
Feb 20 '07 #2
that's correct, yes.

for whatever reason, i simply can't open the database to edit it. i get errors to do with that line, such as:

Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/isproject/confirm.asp, line 74

OR

Type mismatch.

with an error "type mismatch", here's the code i have:

Expand|Select|Wrap|Line Numbers
  1. <% 
  2. objRS.Open "contact", adLockOptimistic, objConn
  3.  
  4. objRS.AddNew 
  5. objRS("name") = Request.Form("name")
  6. objRS("email") = Request.Form("email")
  7. objRS("number") = Request.Form("number")
  8. objRS("postcode") = Request.Form("postcode")
  9. objRS("comments") = Request.Form("comments")
  10. objRS("datecontacted") = Date()
  11. objRS.Update
  12. %>
  13.  
i simply don't understand why... i think i'm saying, "open the contact table, allow it to be edited, using the connection...

then add new record sets according to the values from the form"
Feb 21 '07 #3
jhardman
3,406 Expert 2GB
If your code is as stated above, you might just have arguments out of order.
Expand|Select|Wrap|Line Numbers
  1. objRS.Open "contact", objConn, adOpenDynamic, adLockOptimistic
  2.  
Also, throw in the constant "adOpenDynamic". This just means that you can scroll through the records in multiple directions, but it seems to me that some systems need this as well in order to modify records.

Jared
Feb 22 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Jonathan Fine | last post by:
I'd appreciate comments on what I'm doing. Please be kind, I'm a new kid on the block. Here's my application. I'm writing some test code. (I'm a recent convert to unit testing.)
2
by: JohnnyOnTheSpot | last post by:
If I select from a table and, for example, group by the month or day to determine how much activity there is day to day or month to month, it will only return months and days with a record and...
4
by: wireless | last post by:
I've written code that dynamically builds an sql query based on various constraint possibilities. The problem is the code would have been very complex had I not come up with a dummy constraint...
2
by: John Latten | last post by:
Hi there, I have got a problem when adding extra (= dummy) columns to a datagrid. I have a datagrid that is bound to a datatable. The datatable is filled with data from a SQL Server 2000...
1
by: CSDunn | last post by:
Hello, I am working with a vb6 Windows application that runs on Tablet PC's. There are about five SQL Server 2000 databases that tie into the application. SQL Server MSDE runs on the tablets,...
15
by: glenn | last post by:
Hi folks, I have a DropDownList in a DataGrid that is populated from records in a database. I want to add a value that might be a string such as "Select a Company" for the first item since an...
3
by: Logos | last post by:
Hi friends and neighbours! Gotta problem, maybe you can help... I'm using a dummy # reference in an href so I can use the onclick event. This works well. The problem comes when a user hits...
3
by: Simon Brooke | last post by:
As various people will have noticed, I've been having a lot of trouble with XSL lately. Brief history: I wrote myself an XML toolkit back in 2000, and it worked well enough for me, so it's been...
0
by: Nishanthmarathe | last post by:
Hi There!!! I am new to C# world. I am getting huge chunk of data from a 3rd party applications thru SOAP request and updating to my SQL Server. I cant implement Progress bar as there is no way...
35
by: erik gartz | last post by:
Hi. I'd like to be able to write a loop such as: for i in range(10): pass but without the i variable. The reason for this is I'm using pylint and it complains about the unused variable i. I can...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.