If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > ABC Upload & SQL Error

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-20-03, 10:41
Philby_Walsh Philby_Walsh is offline
Registered User
 
Join Date: Nov 2002
Posts: 13
ABC Upload & SQL Error

I am working on a project which requires that users can visit a web-site & upload/download txt files/images/mp3s along with providing info. in the form describing what they are uploading. This info is then saved to an Oracle DB & the files are uploaded to my web server at college.

This is my progress so far:

I can take in info in a form & save it to the DB no probs.
I can take in an upload and have it stored on my web space no probs. (USING the ABCUpload component)

http://www.websupergoo.com/abcupload-1.htm

The problem is when I try to combine the two in one ASP page I get an error.
Code:
ABCUpload4.XForm.4 error '80004005' 

Upload stopped unexpectedly. 

/bsci99/pwalsh/databases/upload1.asp, line 32
Here is my code:
UPLOAD1.ASP
Code:
<%
Dim dbCon, sql, first, second, band_name, gig_venue, rating
Dim gig_date, web_link, set_list, picture, sound, gig_id
 
band_name = Request.Form("band_name")
gig_venue = Request.Form("gig_venue")
gig_date= Request.Form("gig_date")
web_link = Request.Form("web_link")
set_list = Request.Form("set_list")
picture = Request.Form("picture")
sound = Request.Form("sound")
gig_id = Request.Form("gig_id")
rating = Request.Form("rating")

Set dbCon = Server.CreateObject("ADODB.Connection")
dbCon.Open("DSN=BISDATA; UID=99089980; PWD=hIlton12") 

sql = "INSERT INTO GIG (gig_id, band_name, gig_venue, rating, web_link, gig_date) VALUES ('"&gig_id&"','"&band_name&"','"&gig_venue&"','"&rating&"','"&web_link&"','"&gig_date&"');"

dbCon.BeginTrans
dbCon.Execute(sql)
dbCon.CommitTrans

dbCon.Close
Set dbCon = nothing
%>
Insertion complete

<% 
Set theForm = Server.CreateObject("ABCUpload4.XForm")
theForm("rev")(1).Save "myupload.txt"
%>
My HTML PAGE

Code:
<html>
<head><title>Database insert</title></head>
<body>
<center>
<h1><b>Gig Record Insertion</b></h1>
<form method="post" action="upload1.asp" enctype="multipart/form-data">
<table border="1" width="34%">
  <tr>
    <td width="45%">Band Name:</td>
    <td width="65%">
        <p><input type="text" name="band_name" size="20"></p>
    </td>
  </tr>
  <tr>
    <td width="45%">Gig Venue:</td>
    <td width="65%"><input type="text" name="gig_venue" size="20"></td>
  </tr>
  <tr>
    <td width="45%">Gig Date:</td>
    <td width="65%">
        <p><input type="text" name="gig_date" size="20"></p>
    </td>
  </tr>
  <tr>
    <td width="45%">Web Link:</td>
    <td width="65%">
        <p><input type="text" name="web_link" size="25"></p>
    </td>
  </tr>
  <tr>
    <td width="45%">Review:</td>
    <td width="65%">
        <p><input type="file" name="rev"></p>
    </td>
  </tr>
  <tr>
    <td width="45%">Set-List:</td>
    <td width="65%">
        <p><input type="text" name="set_list" size="20"></p>
    </td>
  </tr>
	<tr>
    <td width="45%">Picture:</td>
    <td width="65%">
        <p><input type="text" name="picture" size="20"></p>
    </td>
  </tr>
	<tr>
    <td width="45%">Sound:</td>
    <td width="65%">
        <p><input type="text" name="sound" size="20"></p>
    </td>
  </tr>
  <tr>
    <td width="45%">Rating:</td>
    <td width="65%">
        <p><input type="text" name="rating" size="2"></p>
    </td>
  </tr>
  <tr>
    <td width="45%">Gig ID:</td>
    <td width="65%">
        <p><input type="type" name="gig_id" size="3"></p>
    </td>
  </tr>
  </table>
<p><input type="submit" value="Submit" name="Submit"></p>
</center></form>
</body></html>
why is it that I can't combine these two techniques in one ASP page?

Any help would be greatly appreciated.
Reply With Quote
  #2 (permalink)  
Old 01-31-03, 04:45
JonathanB JonathanB is offline
Registered User
 
Join Date: Feb 2002
Location: North Wales, UK
Posts: 114
If you have just joined the two pages together that will be why. Your ASP code expects a form to be submitted to it... if it hasn't got one it fails. When the combined page is first requested your ASP code has no form full of information for it so it fails.

Add this code to the top:

Quote:
<%
if request.form("Submit") = "Submit" then
%>
Between the code page and the HTML form add this code:

Quote:
<%
else
%>
Finally add this code below the HTML form:

Quote:
<%
end if
%>
__________________
J^ - web | email
newsASP Developer
Reply With Quote
  #3 (permalink)  
Old 02-10-03, 06:11
vineetall vineetall is offline
Registered User
 
Join Date: Feb 2003
Posts: 11
Hi often when u do coding in mixed mode i.e. form data + file upload then these components fail You can try ASP smart upload for that purpose.It has a syntex which specifies how to use it for mixed mode coding.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On