Current location: Hot Scripts Forums » Programming Languages » ASP » ASP Upload and add link to database


ASP Upload and add link to database

Reply
  #1 (permalink)  
Old 06-15-05, 10:13 AM
minority minority is offline
Wannabe Coder
 
Join Date: Jun 2005
Posts: 145
Thanks: 0
Thanked 0 Times in 0 Posts
ASP Upload and add link to database

Hi can anyone help me i require a upload asp script that will upload it to a folder location.

Also need to get hold of the file name+extention eg mydoc.doc and add it to the upload directory and place this in a access database. I am not sure how to do any of this can i just append the file name directly to the weblink location or do i need to parse it to get hold of the file name.

Sorry if this doesnt make sence finding it hard to explain what i am trying to do.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 06-15-05, 05:15 PM
koncept
Guest
 
Posts: n/a
no it makes sense i would be glad to help you with this. i use pureaspupload to put my files on servers. are you using a component supplied by your host or another method?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 06-16-05, 03:49 AM
minority minority is offline
Wannabe Coder
 
Join Date: Jun 2005
Posts: 145
Thanks: 0
Thanked 0 Times in 0 Posts
My host is looking into whether they can host a active x dll but they are not sure since others also use the hosting box.

I was hoping on just a ASP solution with a way of uploading the link to the file to a access database.

Ive looked at several upload scripts but they are confusing and am not sure what and if i can grab the file name from them?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 06-16-05, 06:29 AM
minority minority is offline
Wannabe Coder
 
Join Date: Jun 2005
Posts: 145
Thanks: 0
Thanked 0 Times in 0 Posts
Hey was looking at another post

Code:
<%@ Language=VBScript %>
<%Option Explicit%>
<!-- #include file="upload.asp" -->
<!--#include file="cdovbs.inc" -->
<%
' Create the FileUploader
Dim Uploader, File
Set Uploader = New FileUploader

' This starts the upload process
Uploader.Upload()

' Loop through the uploaded files
For Each File In Uploader.Files.Items

' Save the file to a directory of your server
File.SaveToDisk Server.MapPath("/tst-em-form-upload/")
is that all i would need or would i also need to include the upload.asp file that they are using?

If this would be okay or needs more could you please help? and what would be required to get the file name?

Thanks for your help
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 06-16-05, 07:45 AM
koncept
Guest
 
Posts: n/a
you would need the upload.asp file they are talking about. I am giving you one that I use. the only file you should need to edit will be db-file-to-disk.asp (it can be renamed too)

it is very nice in my opinon and has the ability to do what you want easily
Attached Files
File Type: zip file upload db add.zip (9.8 KB, 493 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 06-16-05, 09:11 AM
minority minority is offline
Wannabe Coder
 
Join Date: Jun 2005
Posts: 145
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks

See if i can get that working once my server space is ready. currently using IIs on my xp prof....

Do you happen to kn ow if IIS supports microsoft access drivers as i am trying to access a databse but keep getting an error with this one line

adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("qrm.mdb")
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 06-16-05, 09:28 AM
koncept
Guest
 
Posts: n/a
it supports them nicley as that is the only databae i can use and i have many currently running.

the connection string i use is:
Code:
 <%
 dim adocon
 dim strcon
 Set adoCon = Server.CreateObject("ADODB.Connection")
 strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("users.mdb")
 adoCon.Open strCon
 %>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #8 (permalink)  
Old 06-16-05, 10:03 AM
minority minority is offline
Wannabe Coder
 
Join Date: Jun 2005
Posts: 145
Thanks: 0
Thanked 0 Times in 0 Posts
Cant figure this out keep getting an error (Now a different one)

Could you please check that this code is correct?

Code:
<%
	 Dim adoCon
	 Dim rsGeolink
	 Dim strSQL
	 Dim strSQL2	
	 Set adoCon = Server.CreateObject("ADODB.Recordset") 
	 Set rsGeolink = Server.CreateObject("ADODB.Recordset")
	 adoCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("qrm.mdb")
	  rsGeolink.Open strSQL, adoCon
	 strSQL = "SELECT Department.Dept_ID FROM Department;"
              strSQL2 = "SELECT Department.Dept_Name From Department;"
	 Do While not rsGeolink.EOF
	 <a href="editjob1.asp?dept_id=StrSQL#"> Response.Write Geolink(strSQL2)</a>
	   rsGeolink.MoveNext
	Loop
	rsGeolink.Close
	Set rsGeolink = Nothing
	Set adoCon = Nothing	
	%>
I might also have my link statment wrong on line 212 i think
The error is

Error Type:
ADODB.Recordset (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/IIShelp/geolink/Admin/editjob.asp, line 209
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #9 (permalink)  
Old 06-16-05, 11:31 PM
koncept
Guest
 
Posts: n/a
wow, i never realized till you just posted your code i have more stuff in mine than is needed...

two main things that i saw. you were setting adocon = to a server object and it didnt need to be. second the strsql came after you tried to open it so that string was blank and it didnt know what to do.

two spruce ups...first i combined your sql statements, second i put the output of the db into the link as you were going to do..
Code:
  <%
 	 Dim strCon
 	 Dim rsGeolink
 	 Dim strSQL
 	 Dim strSQL2	
 	 Set rsGeolink = Server.CreateObject("ADODB.Recordset")
 	 strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("qrm.mdb")
 	 strSQL = "SELECT Dept_ID, Dept_Name FROM Department"
 	  rsGeolink.Open strSQL, strCon
 
 	 Do While not rsGeolink.EOF
 %>
	 <a href="editjob1.asp?dept_id=<%=rsgeolink("dept_id")%>"><%=rsgeolink("dept_name")%></a>
<%
 	   rsGeolink.MoveNext
 	Loop
 	rsGeolink.Close
 	Set rsGeolink = Nothing
 	%>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #10 (permalink)  
Old 06-17-05, 05:36 AM
minority minority is offline
Wannabe Coder
 
Join Date: Jun 2005
Posts: 145
Thanks: 0
Thanked 0 Times in 0 Posts
Hey again sorry to annoy you again but i changed the sql statment as noticed it was pointing in the wrong place. But now i get an unkown error?

Code:
<%
 	 Dim strCon
 	 Dim rsGeolink
 	 Dim strSQL	
 	 Set rsGeolink = Server.CreateObject("ADODB.Recordset")
 	 strCon = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("qrm.mdb")
 	 strSQL = "SELECT Position_ID, Position_Name FROM Position"
 	  rsGeolink.Open strSQL, strCon
 	 Do While not rsGeolink.EOF
 %> 
  <table width ="100%">
		  	<tr>
		  		<td width = "10%"></td>	
		  		<td width = "10%"></td>
				<td width = "25%"></td>	

		  	</tr>
		  	<tr>
		  		<td width = "10%"></td>	
		  		<td width = "10%"><center><strong><a href="editjob1.asp?position_id=<%=rsgeolink("position_id")%>"><%=rsgeolink("position_name")%></a></strong></center><br><br></td>
				<td width = "25%"> </td>	
		  	</tr>
		  </table>
		    
<%
 	rsGeolink.MoveNext
 	Loop
 	rsGeolink.Close
	Set rsGeolink = Nothing
 	%>
the error i am now getting is
Error Type:
(0x80004005)
Unspecified error
/IIShelp/geolink/Admin/editjob.asp, line 200

Is this due to the connection to the server not being cut off as i do not have the file open?

Also how do you get it to connect to a source other than the directory path as i want it to sit within the database folder and the rest of the code in different folders?

Sorry about all the questions but first time i have used Access for my database.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Image Upload and Text in one go php-learner Script Requests 2 04-28-05 01:42 PM
PHP Script Request DazzlyWorks Script Requests 0 01-16-05 02:23 PM
Image upload and if / else mdhall PHP 4 11-14-04 04:12 PM
If statement in file upload mdhall PHP 4 04-12-04 06:33 PM


All times are GMT -5. The time now is 06:55 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.