Solved

Upload Script not uploading information

Posted on 2009-04-15
3
301 Views
Last Modified: 2012-05-06
ok i will put 2 posts of code from 2 different sheets.
I have a problem where the code i have written isn't writing the information onto the database.
(the database has read and write permission to everyone.)
<%
Dim adoCon          'Holds the Database Connection Object
Dim rsAddComments   'Holds the recordset for the new record to be added
Dim strSQL          'Holds the SQL query to query the database
 
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("******.mdb")
 
Set rsAddComments = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT tblComments.Drawings_Number, tblComments.Drawing_Title FROM tblComments;"
 
rsAddComments.CursorType = 2
rsAddComments.LockType = 3
rsAddComments.Open strSQL, adoCon
 
rsAddComments.AddNew
 
rsAddComments.Fields("Drawings_Number") = Request.Form("Drawings_Number")
rsAddComments.Fields("Drawing_Title") = Request.Form("Drawing_Title")
 
rsAddComments.Update
rsAddComments.Close
Set rsAddComments = Nothing
Set adoCon = Nothing
Response.Redirect "dwgreg.asp"
%>

Open in new window

0
Comment
Question by:Roy_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

by:Roy_
ID: 24148523
ok and this is my form code:
<html>
<head>
<title>Drawing Information</title>
</head>
<body bgcolor="white" text="black">
<!-- Begin form code -->
	 <form action="add_to_register.asp" method="post" enctype="multipart/form-data" name="form">
     Drawing Title: 
      <img src="../../***************************/spacer.gif" width="63" height="6" alt="">
      <label>
      <input type="text" name="Drawings_Number" maxlength="50">
      </label>
      <br>
      Drawings Number:<img src="../../***********************/spacer.gif" width="37" height="9" alt="">
     <input type="text" name="Drawing_Title" maxlength="50">
     <input type="submit" name="Submit" value="Submit">
 </form>
<!-- End form code -->
</body>
</html>

Open in new window

0
 

Author Comment

by:Roy_
ID: 24148555
(a bit more information)
it doesn't come up with an error message, just enters blank data.

Any ideas?
TIA
-R
0
 
LVL 28

Accepted Solution

by:
sybe earned 250 total points
ID: 24155244
If you use enctype="multipart/form-data" in the form (as you do), you can not use Request.Form, because there will be no values in it. That explains why you get blank data in your database.

multipart/formdata is meant to be used with fileupload. I see no fileupload in your form, so the solution would be do not use it.

<form action="add_to_register.asp" method="post" name="form">
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
This video discusses moving either the default database or any database to a new volume.
Suggested Courses
Course of the Month5 days, 15 hours left to enroll

627 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question