473,795 Members | 2,498 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Dummy ASP Problem, but no help on web?

2 New Member
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">F ull Name:</td>
<td class="data"><i nput 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">C ontact Number:</td>
<td><input type="text" name="number" /></td>
</tr>
<tr>
<td class="label">P ostcode</td>
<td><input type="text" name="postcode" /></td>
</tr>
</table>
<p>Further Information: </p>
<p><textarea name="comments" rows="5" cols="70">Pleas e 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 1402
jhardman
3,406 Recognized Expert Specialist
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
mcchristie
2 New Member
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 Recognized Expert Specialist
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
1305
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
5160
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 leave out any month or day without any records making it apear at a glance that every day or month has activity which forces me or whoever to have to look at the date column and actively look for spots where a day or more elapses without a single row...
4
2917
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 as a kind of place holder in the statement. To avoid complex logic that determines if there was another constraint before any other constraint and hence the need to add, say, AND or not, I came up with a dummy constraint so that every subsequent...
2
447
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 database. This data contains a column that is a foreign key to another table. In my datagrid I don't want to display this keyvalue. Instead I want to use this key to get a description out of another table. I have added an extra column to both the...
1
1550
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, and currently there is only one instance running. There are efforts underway to upgrade the application to a .NET SmartClient. One enhancement that needs to be made to the current application will be to provide a 'training mode' in the...
15
3132
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 OnSelectedIndex event is not fired if you select the first item. Does anyone know of an easy way to do this?
3
1842
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 the browser's reload button...the Address Bar now reads http://mydomain//mypage.html#, and this produces weird javascript errors on line 1. I tried adding a phony href (<a href="#" onclick="window.location.reload(true)"></a>) to refresh, but...
3
4243
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 little changed since. However, it works only with an obsolete version of Saxon (6.2.2 I think), and it has a number of small bugs; and I've at last got to the point where I need to fix it. And I'm finding it, frankly, absurdly frustrating and...
0
1280
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 to know how much data i will get back and its a complicated process. So i decided to use a dummy progress bar, that is 5 moving dots, Which in turn gives user feeling of some progress happening. But if i comment the actual getting data part...
35
21588
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 achieve the above with more lines of code like: i = 0 while (i != 10): i += 1 Is there a concise way to accomplish this without adding extra lines
0
9672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10436
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10213
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10163
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10000
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9040
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7538
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6780
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.