Advertisement

08.13.2008 at 01:15AM PDT, ID: 23643864
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.6

ASP upload form & SQL database

Asked by it_ops in Active Server Pages (ASP), SQL Server 2005

Tags: ,

Hi

I'm using Persits Upload and have an upload form that's working fine - currently all the user does is browse for the file and then uploads the file to a SQL database.

I'd like to be able to add extra functionality by having the user select a name from a drop down list within the form, this name is then added to the SQL database along with the file.

The code attached has a basic drop down list that allows the user to select a user but after that I'm not sure how you would go about writing that value to the SQL database.

Here is the code:

Thanks for any help.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="files6.asp">
		File: <INPUT TYPE=FILE NAME="THEFILE"><P>
		Description: <TEXTAREA NAME="DESCR"></TEXTAREA><BR>
  		<select name="dropdownlist">
		<option value="Lolly Badcock">Lolly Badcock</option>
		<option value="Jenna Jameson">Jenna Jameson</option>
		<option value="Teagan Presley">Teagan Presley</option>
		</select><br><br>
		<INPUT TYPE=SUBMIT VALUE="Upload">
	
	</FORM>
</p>
 
<%
	
	Set Upload = Server.CreateObject("Persits.Upload")
	Upload.IgnoreNoPost = True
	Upload.OverwriteFiles = False
 
	' Capture files
	Upload.Save "c:\temp"
 
	' Obtain file object
	Set File = Upload.Files("THEFILE")
 
	If Not File Is Nothing Then
		' Build ODBC connection string
		'Connect = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath(".\aspupload1.mdb")
 
		' If you use SQL Server, the connecton string must look something like this:
 
		Connect = "Driver=SQL SERVER;Server=xxx\SQLEXPRESS;Database=master;UID=user;PWD=xxxxxxx"
 
		' Build SQL INSERT statement
		SQL = "INSERT INTO MYIMAGES(image_blob, filename, description, web_name, upload_date, filesize) VALUES(?, '"
		SQL = SQL & File.Filename & "', '"
		SQL = SQL & Replace(Upload.Form("DESCR"), "'", "''") & "', "
                SQL = SQL & " '" & Request.ServerVariables("LOGON_USER") & "', "
	        SQL = SQL & " " & "getdate()" & ", "
                SQL = SQL & File.Size & ")"'
 
		' Save to database
		File.ToDatabase Connect, SQL
		Response.Write "File successfully uploaded."
	Else
		Response.Write "Please select a file."
	End If
%>
[+][-]08.13.2008 at 05:19AM PDT, ID: 22221001

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.14.2008 at 02:52AM PDT, ID: 22228830

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.14.2008 at 05:03AM PDT, ID: 22229372

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.14.2008 at 05:16AM PDT, ID: 22229467

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.14.2008 at 05:32AM PDT, ID: 22229587

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.14.2008 at 07:10AM PDT, ID: 22230429

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.14.2008 at 07:17AM PDT, ID: 22230502

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.14.2008 at 07:25AM PDT, ID: 22230576

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.14.2008 at 07:35AM PDT, ID: 22230668

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Active Server Pages (ASP), SQL Server 2005
Tags: Microsoft, ASP
Sign Up Now!
Solution Provided By: R_Harrison
Participating Experts: 1
Solution Grade: A
 
 
[+][-]08.14.2008 at 08:02AM PDT, ID: 22230924

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.14.2008 at 08:54AM PDT, ID: 22231385

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.15.2008 at 01:01AM PDT, ID: 22236594

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]08.15.2008 at 01:24AM PDT, ID: 22236644

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628