navigation
a webmaster learning community
     Home    Register     Search      Help      Login    
Sponsors

Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.

Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.

Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

Search Forums
 

Advanced search
Recent Posts

 Todays Posts
 Most Active posts
 Posts since last visit
 My Recent Posts
 Mark posts read

Microsoft MVP

 

Upload file reference to DRW

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP and Database >> Upload file reference to DRW
Page: [1] 2   next >   >>
 
walrus

 

Posts: 542
Joined: 3/13/2003
From: London
Status: offline

 
Upload file reference to DRW - 3/27/2003 15:56:50   
Okay, so now I' ve got Spooky' s Login and Diet sussed.
Moten' s upload is a peach. I Just need to know how to put the two together. This is gonna be dead easy for you DB guys.
How does my data entry form (form.asp) move smoothly to the file upload form (DEMO.asp) then link the two in the database, so that the results can always appear/edit/delete together.
' The image is saved in the /fpdb folder.
' The form saves to " results.mdb" in the /fpdb folder.
What' s the best way of linking the two?
I know this is obvious but please bear with me.
Thanks


< Message edited by Spooky -- 5/26/2003 9:33 PM >


_____________________________

I hope The Boss isn't reading this, ...she thinks I program everything!
Spooky

 

Posts: 26597
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Match the Face to the Place! - 3/27/2003 22:21:35   
You just use the same form to add the record at the same time :)

(I know, sounds too easy ;-) Unfortunately its not.
I havent got a copy of the files here, but Ill see what I can post tommorrow.

The code this discussion references is here

< Message edited by Spooky -- 5/26/2003 9:31 PM >


_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to walrus)
walrus

 

Posts: 542
Joined: 3/13/2003
From: London
Status: offline

 
RE: Match the Face to the Place! - 3/28/2003 13:42:09   
I eagerly await any information you can supply. Thanks

_____________________________

I hope The Boss isn't reading this, ...she thinks I program everything!

(in reply to Spooky)
walrus

 

Posts: 542
Joined: 3/13/2003
From: London
Status: offline

 
RE: Match the Face to the Place! - 3/29/2003 3:53:47   
You haven' t forgotten me have you Spooky.:)

_____________________________

I hope The Boss isn't reading this, ...she thinks I program everything!

(in reply to Spooky)
Spooky

 

Posts: 26597
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Match the Face to the Place! - 3/29/2003 14:51:56   
Sorry, got busy :)
Basically you have to use a combination of the 2 files.

In the todatabase file, youll see the method used to save the file to database.
However, you want a combination of these - file to folder and record to database.

For a multipart/form-data form, you cannot use the same methods as you do for normal database entries - hence the difficulty uploading both in one smooth process.
You can however use the methods provided by the class

Instead of using the normal asp method:
objRs.Fields(" FileName" ).Value = Request.Form(" File1" )

You must use :
objRs.Fields(" FileName" ).Value = objUpload.Fields(" File1" ).FileName

However, the database design and content must be matched to your design

Set objConn = Server.CreateObject(" ADODB.Connection" )
Set objRs = Server.CreateObject(" ADODB.Recordset" )
objConn.Open " DRIVER=Microsoft Access Driver (*.mdb);DBQ="  & Server.MapPath(" Files.mdb" )
objRs.Open " Files" , objConn, 3, 3
objRs.AddNew
objRs.Fields(0).Value = objUpload.Fields(" Field1" ).FileName
objRs.Fields(1).Value = objUpload.Fields(" Field2" ).FileName
objRs.Fields(2).Value = objUpload.Fields(" Field3" ).FileName
objRs.Fields(3).Value = objUpload.Fields(" Field4" ).FileName
objRs.Update
objRs.Close





< Message edited by Spooky -- 3/29/2003 2:52 PM >


_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to walrus)
walrus

 

Posts: 542
Joined: 3/13/2003
From: London
Status: offline

 
RE: Match the Face to the Place! - 3/30/2003 4:25:44   
Thanks Spooky. I see the code you refer to
objRs.Open " Files" , objConn, 3, 3
objRs.AddNew
objRs.Fields(" FileName" ).Value = objUpload.Fields(" File1" ).FileName
objRs.Fields(" FileSize" ).Value = objUpload.Fields(" File1" ).Length
objRs.Fields(" ContentType" ).Value = objUpload.Fields(" File1" ).ContentType
objRs.Fields(" BinaryData" ).AppendChunk objUpload(" File1" ).BLOB & ChrB(0)
I assume that you mean I should use all this code but for a second image...
objRs.Open " Files" , objConn, 3, 3
objRs.AddNew
objRs.Fields(" FileName" ).Value = objUpload.Fields(" File2" ).FileName
objRs.Fields(" FileSize" ).Value = objUpload.Fields(" File2" ).Length
objRs.Fields(" ContentType" ).Value = objUpload.Fields(" File2" ).ContentType
objRs.Fields(" BinaryData" ).AppendChunk objUpload(" File2" ).BLOB & ChrB(0)
or have I misunderstood. (very likely)
Im just not sure of the mechanics of how to order things. I am hoping to have a form where the user will enter the address details of a property.
http://www.londonrent.net/input/input.asp
At the end of the form they can then upload a photo of the house. Im not quite sure whether I should be looking at two sepearate forms
1. Submit record
2. Upload file
or whether these two functions are combined within a single page. (seems unlikely)
Please help me with the process. I dont have an example page that I could refer to. :)

< Message edited by walrus -- 3/30/2003 4:32 AM >


_____________________________

I hope The Boss isn't reading this, ...she thinks I program everything!

(in reply to Spooky)
Spooky

 

Posts: 26597
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Match the Face to the Place! - 3/30/2003 15:20:38   
Do you have the first stage of the form? (Save the user record?)

If so, we may be able to modify that for you if you post it here. Using the DRW may be a problem though.

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to walrus)
walrus

 

Posts: 542
Joined: 3/13/2003
From: London
Status: offline

 
RE: Match the Face to the Place! - 3/31/2003 2:30:04   
<%
'  FP_ASP ASP Automatically generated by a Frontpage Component. Do not Edit.
On Error Resume Next

strErrorUrl = " " 

If Request.ServerVariables(" REQUEST_METHOD" ) = " POST"  Then
If Request.Form(" VTI-GROUP" ) = " 0"  Then
	Err.Clear

	Set fp_conn =  Server.CreateObject(" ADODB.Connection" )
	FP_DumpError strErrorUrl, " Cannot create connection" 

	Set fp_rs = Server.CreateObject(" ADODB.Recordset" )
	FP_DumpError strErrorUrl, " Cannot create record set" 

	fp_conn.Open Application(" input_ConnectionString" )
	FP_DumpError strErrorUrl, " Cannot open database" 

	fp_rs.Open " Results" , fp_conn, 1, 3, 2 '  adOpenKeySet, adLockOptimistic, adCmdTable
	FP_DumpError strErrorUrl, " Cannot open record set" 

	fp_rs.AddNew
	FP_DumpError strErrorUrl, " Cannot add new record set to the database" 
	Dim arFormFields0(21)
	Dim arFormDBFields0(21)
	Dim arFormValues0(21)

	arFormFields0(0) = " Mobile" 
	arFormDBFields0(0) = " Mobile" 
	arFormValues0(0) = Request(" Mobile" )
	arFormFields0(1) = " DSS" 
	arFormDBFields0(1) = " DSS" 
	arFormValues0(1) = Request(" DSS" )
	arFormFields0(2) = " Agent" 
	arFormDBFields0(2) = " Agent" 
	arFormValues0(2) = Request(" Agent" )
	arFormFields0(3) = " Town" 
	arFormDBFields0(3) = " Town" 
	arFormValues0(3) = Request(" Town" )
	arFormFields0(4) = " Street" 
	arFormDBFields0(4) = " Street" 
	arFormValues0(4) = Request(" Street" )
	arFormFields0(5) = " Period" 
	arFormDBFields0(5) = " Period" 
	arFormValues0(5) = Request(" Period" )
	arFormFields0(6) = " Desciption" 
	arFormDBFields0(6) = " Desciption" 
	arFormValues0(6) = Request(" Desciption" )
	arFormFields0(7) = " Day" 
	arFormDBFields0(7) = " Day" 
	arFormValues0(7) = Request(" Day" )
	arFormFields0(8) = " Building" 
	arFormDBFields0(8) = " Building" 
	arFormValues0(8) = Request(" Building" )
	arFormFields0(9) = " Rent" 
	arFormDBFields0(9) = " Rent" 
	arFormValues0(9) = Request(" Rent" )
	arFormFields0(10) = " Email" 
	arFormDBFields0(10) = " Email" 
	arFormValues0(10) = Request(" Email" )
	arFormFields0(11) = " Contact" 
	arFormDBFields0(11) = " Contact" 
	arFormValues0(11) = Request(" Contact" )
	arFormFields0(12) = " Type" 
	arFormDBFields0(12) = " Type" 
	arFormValues0(12) = Request(" Type" )
	arFormFields0(13) = " City" 
	arFormDBFields0(13) = " City" 
	arFormValues0(13) = Request(" City" )
	arFormFields0(14) = " Phone" 
	arFormDBFields0(14) = " Phone" 
	arFormValues0(14) = Request(" Phone" )
	arFormFields0(15) = " Username" 
	arFormDBFields0(15) = " Username" 
	arFormValues0(15) = Request(" Username" )
	arFormFields0(16) = " Year" 
	arFormDBFields0(16) = " Year" 
	arFormValues0(16) = Request(" Year" )
	arFormFields0(17) = " Term" 
	arFormDBFields0(17) = " Term" 
	arFormValues0(17) = Request(" Term" )
	arFormFields0(18) = " Month" 
	arFormDBFields0(18) = " Month" 
	arFormValues0(18) = Request(" Month" )
	arFormFields0(19) = " Students" 
	arFormDBFields0(19) = " Students" 
	arFormValues0(19) = Request(" Students" )
	arFormFields0(20) = " Postcode" 
	arFormDBFields0(20) = " Postcode" 
	arFormValues0(20) = Request(" Postcode" )

	FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0

	If Request.ServerVariables(" HTTP_USER_AGENT" ) <> " "  Then
		FP_SaveFieldToDB fp_rs, Request.ServerVariables(" HTTP_USER_AGENT" ), " Browser_type" 
	End If
	If Request.ServerVariables(" REMOTE_HOST" ) <> " "  Then
		FP_SaveFieldToDB fp_rs, Request.ServerVariables(" REMOTE_HOST" ), " Remote_computer_name" 
	End If
	FP_SaveFieldToDB fp_rs, Now, " Timestamp" 
	If Request.ServerVariables(" REMOTE_USER" ) <> " "  Then
		FP_SaveFieldToDB fp_rs, Request.ServerVariables(" REMOTE_USER" ), " User_name" 
	End If

	fp_rs.Update
	FP_DumpError strErrorUrl, " Cannot update the database" 

	fp_rs.Close
	fp_conn.Close

	FP_FormConfirmation " text/html; charset=windows-1252" ,_
						" Form Confirmation" ,_
						" Thank you for submitting the following information:" ,_
						" input.asp" ,_
						" Return to the form." 

End If
End If

%>


_____________________________

I hope The Boss isn't reading this, ...she thinks I program everything!

(in reply to Spooky)
Spooky

 

Posts: 26597
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Match the Face to the Place! - 4/1/2003 17:42:22   
It is near impossible to do that with the DRW - the main issue is the way it uses includes and the request object. Its incompatible with the upload class form type.

The example I gave above is needed :

Set objConn = Server.CreateObject(" ADODB.Connection" )
Set objRs = Server.CreateObject(" ADODB.Recordset" ) 
objConn.Open " DRIVER=Microsoft Access Driver (*.mdb);DBQ="  & Server.MapPath(" Files.mdb" )  
objRs.Open " Files" , objConn, 3, 3 
objRs.AddNew  
objRs.Fields(" Mobile" ).Value = objUpload.Fields(" Mobile" ).FileName  
objRs.Fields(" DSS" ).Value = objUpload.Fields(" DSS" ).FileName  
objRs.Fields(" Agent" ).Value = objUpload.Fields(" Agent" ).FileName  
objRs.Fields(" Town" ).Value = objUpload.Fields(" Town" ).FileName 
etc.... (your fields)
objRs.Update  
objRs.Close


This is using vbScript to acheive what the DRW is doing. For each form input (objUpload.Fields(" x" ).FileName ) add it to the database field (objRs.Fields(" Mobile" ).Value)

To achieve this on one page, you need to add all form input to the database. Realistically, its the only way to keep it on the same page.



< Message edited by Spooky -- 4/1/2003 5:43 PM >


_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to walrus)
walrus

 

Posts: 542
Joined: 3/13/2003
From: London
Status: offline

 
RE: Match the Face to the Place! - 4/2/2003 1:51:14   
Im slightly confused by this.
quote:

It is near impossible to do that with the DRW - the main issue is the way it uses includes and the request object. Its incompatible with the upload class form type.
The page doesn' t use a DRW, it only uses a form component. Or are you saying that when the page is posted it cannot go to a DRW?

_____________________________

I hope The Boss isn't reading this, ...she thinks I program everything!

(in reply to Spooky)
Spooky

 

Posts: 26597
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Match the Face to the Place! - 4/2/2003 1:58:46   
Youll find the code will post to itself (The code you pasted above)
So, while you may only see a form, the Frontpage bot adds that asp code as well.

If it were posted to another page (with a DRW) the result would still be the same.

Anthing that uses the request obect will fail.

ie - in your code above
arFormValues0(0) = Request(" Mobile" )

This is the request object - it will work with a normal POST form

However, for multipart forms (ie posting binary files) you need to use the methods supplied by that object or class , in this case : objUpload.Fields(" mobile" ).FileName

Its not reasonable to modify the DRW to this extent as it uses shared include files. Any changes are global.



_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to walrus)
walrus

 

Posts: 542
Joined: 3/13/2003
From: London
Status: offline

 
RE: Match the Face to the Place! - 4/2/2003 12:39:39   
Thanks very much for the explanation Spooky, which better clarifies what you' ve posted before. I give it a go!

_____________________________

I hope The Boss isn't reading this, ...she thinks I program everything!

(in reply to Spooky)
Spooky

 

Posts: 26597
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Match the Face to the Place! - 4/2/2003 14:41:59   
Start it off, we will guide you through it.

Have a form page with all of your info, leave out the image for now.
Post it to page 2. Page 2 will be used to process all of the form (and image) at the same time.

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to walrus)
walrus

 

Posts: 542
Joined: 3/13/2003
From: London
Status: offline

 
RE: Match the Face to the Place! - 4/3/2003 13:17:24   
If I know the format I will work it through so here is the basic first step
<html>

<head>
<meta http-equiv=" Content-Language"  content=" en-gb" >
<meta http-equiv=" Content-Type"  content=" text/html; charset=windows-1252" >
<meta name=" GENERATOR"  content=" Microsoft FrontPage 4.0" >
<meta name=" ProgId"  content=" FrontPage.Editor.Document" >
<title>LondonMove Page 1</title>
<meta name=" Microsoft Theme"  content=" construc 111, default" >
</head>

<body>

<h2>LondonMove Page 1</h2>
<form method=" POST"  action=" helpme2.asp" >
  <p><label for=" fp1" >Number</label> <input type=" text"  name=" Number"  size=" 20"  id=" fp1" ></p>
  <p><label for=" fp2" >Street </label><input type=" text"  name=" Street"  size=" 20"  id=" fp2" ></p>
  <p><input type=" submit"  value=" Submit"  name=" B1" ><input type=" reset"  value=" Reset"  name=" B2" ></p>
</form>

</body>

</html>

This page is live at
http://www.londonrent.net/helpme1.asp
and
http://www.londonrent.net/helpme2.asp
I hope this what you meant.
I appreciate your help with this, I know you are busy with a real job too : )

_____________________________

I hope The Boss isn't reading this, ...she thinks I program everything!

(in reply to Spooky)
Spooky

 

Posts: 26597
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Match the Face to the Place! - 4/3/2003 23:05:21   

On page 2, we' ll use code similar to this to start with :


<%
Set objConn = Server.CreateObject(" ADODB.Connection" )
Set objRs = Server.CreateObject(" ADODB.Recordset" ) 

objConn.Open @@@@@@@@

objRs.Open " @@@ Your Table @@@@" , objConn, 3, 3 

objRs.AddNew  
objRs.Fields(" Number" ).Value = request(" Number" )
objRs.Fields(" Street" ).Value = request(" Street" )
objRs.Update  

objRs.Close

Response.write " Record Added" 
%>


Add the name of YOUR table here
objRs.Open " @@@ Your Table @@@@" , objConn, 3, 3

Add the name of YOUR connection here :
objConn.Open @@@@@@@@

This will be found in your globasl.asa file.
It may be called " Application(" Results_Connectionstring" )" , so your final connection will look like this :

objConn.Open Application(" Results_Connectionstring" )


_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to Spooky)
walrus

 

Posts: 542
Joined: 3/13/2003
From: London
Status: offline

 
RE: Match the Face to the Place! - 4/4/2003 2:31:20   
Very good so far!
[color=#993300]<% 
Set objConn = Server.CreateObject(" ADODB.Connection" )
Set objRs = Server.CreateObject(" ADODB.Recordset" )

objConn.Open Application(" helpme1_ConnectionString" )

objRs.Open " Results" , objConn, 3, 3

objRs.AddNew
objRs.Fields(" Number" ).Value = request(" Number" )
objRs.Fields(" Street" ).Value = request(" Street" )
objRs.Update

objRs.Close

Response.write " Record Added" 
%>[/color]

<html>

<head>
<meta http-equiv=" Content-Type"  content=" text/html; charset=windows-1252" >
<meta name=" GENERATOR"  content=" Microsoft FrontPage 4.0" >
<meta name=" ProgId"  content=" FrontPage.Editor.Document" >
<title>New Page 1</title>
<meta name=" Microsoft Theme"  content=" construc 111, default" >
</head>

<body>

<p> </p>

</body>

</html>

Thanks for the very clear instructions Spooky.

_____________________________

I hope The Boss isn't reading this, ...she thinks I program everything!

(in reply to Spooky)
Spooky

 

Posts: 26597
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Match the Face to the Place! - 4/4/2003 4:24:38   
Now, firstly, can you confirm that the record is indeed added to your database?

Ok - next step, notice the changes :

First in the post form :
<form method=" POST"  action=" helpme2.asp" > 

Becomes :
<FORM method=" POST"  [color=#993300]encType=" multipart/form-data" [/color] action=" helpme2.asp" > 


Then in page 2

[color=#993300]<!--#INCLUDE FILE=" clsUpload.asp" -->[/color]
[color=#999999]<% 
Set objConn = Server.CreateObject(" ADODB.Connection" )
Set objRs = Server.CreateObject(" ADODB.Recordset" )

objConn.Open Application(" helpme1_ConnectionString" )

objRs.Open " Results" , objConn, 3, 3

objRs.AddNew
objRs.Fields(" Number" ).Value = [/color][color=#993300]objUpload.Fields(" Number" ).FileName[/color][color=#999999]
objRs.Fields(" Street" ).Value = [/color][color=#993300]objUpload.Fields(" Street" ).FileName[/color][color=#999999]
objRs.Update

objRs.Close

Response.write " Record Added" 
%>

<html>

<head>
<meta http-equiv=" Content-Type"  content=" text/html; charset=windows-1252" >
<meta name=" GENERATOR"  content=" Microsoft FrontPage 4.0" >
<meta name=" ProgId"  content=" FrontPage.Editor.Document" >
<title>New Page 1</title>
<meta name=" Microsoft Theme"  content=" construc 111, default" >
</head>

<body>

<p> </p>

</body>

</html>[/color]


This does assume that the upload class files are in the same directory as this file. (for the include)

Test again, does the record get added to the database?




_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to walrus)
walrus

 

Posts: 542
Joined: 3/13/2003
From: London
Status: offline

 
RE: Match the Face to the Place! - 4/4/2003 13:15:56   
The first step worked fine.
But it doesnt like the changes
Page 1
<FORM method=" POST"  encType=" multipart/form-data"  action=" helpme2.asp" >
  <p><label for=" fp1" >Number</label> <input type=" text"  name=" Number"  size=" 20"  id=" fp1" ></p>
  <p><label for=" fp2" >Street</label> <input type=" text"  name=" Street"  size=" 20"  id=" fp2" ></p>
  <p><input type=" submit"  value=" Submit"  name=" B1" ><input type=" reset"  value=" Reset"  name=" B2" ></p>
</FORM>

Page 2
<!--#INCLUDE FILE=" clsUpload.asp" -->
<% 
Set objConn = Server.CreateObject(" ADODB.Connection" )
Set objRs = Server.CreateObject(" ADODB.Recordset" )

objConn.Open Application(" helpme1_ConnectionString" )

objRs.Open " Results" , objConn, 3, 3

objRs.AddNew
objRs.Fields(" Number" ).Value = objUpload.Fields(" Number" ).FileName
objRs.Fields(" Street" ).Value = objUpload.Fields(" Street" ).FileName
objRs.Update

objRs.Close

Response.write " Record Added" 
%>

Wont show page 2. If I amend page 1 but not page 2 it will save the ID field (I think I mean the key field) but not the two text fields. This means it must be submitting empty fields. If I amend page two as above, it goes toes up.

I dont quite understand this...
quote:

This does assume that the upload class files are in the same directory as this file. (for the include)


_____________________________

I hope The Boss isn't reading this, ...she thinks I program everything!

(in reply to Spooky)
Spooky

 

Posts: 26597
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Match the Face to the Place! - 4/4/2003 13:42:42   
Are the files clsUpload.asp and clsField.asp in the same directory as helpme2.asp ?
If not, they should be !

By toes up, what error is on the page?

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to walrus)
Spooky

 

Posts: 26597
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Match the Face to the Place! - 4/4/2003 13:48:19   
Assuming that is the error or we didnt add the right code [:j], next step :

<FORM method=" POST"  encType=" multipart/form-data"  action=" helpme2.asp" >
  <p><label for=" fp1" >Number</label> <input type=" text"  name=" Number"  size=" 20"  id=" fp1" ></p>
  <p><label for=" fp2" >Street</label> <input type=" text"  name=" Street"  size=" 20"  id=" fp2" ></p>
[color=#CC0000]<p><INPUT type=" File"  name=" File1" ></p>[/color]
  <p><input type=" submit"  value=" Submit"  name=" B1" ><input type=" reset"  value=" Reset"  name=" B2" ></p>
</FORM>


Page 2 (note you will need a colum called " imagepath" or rename to match your column name)

<!--#INCLUDE FILE=" clsUpload.asp" -->
<%
[color=#CC0000]Dim objUpload, strFileName, strPath
Set objUpload = New clsUpload
strFileName = objUpload.Fields(" File1" ).FileName
strPath = Server.MapPath(" fpdb" ) & " \"  & strFileName
objUpload(" File1" ).SaveAs strPath
[/color]

Set objConn = Server.CreateObject(" ADODB.Connection" )
Set objRs = Server.CreateObject(" ADODB.Recordset" )

objConn.Open Application(" helpme1_ConnectionString" )

objRs.Open " Results" , objConn, 3, 3

objRs.AddNew
objRs.Fields(" Number" ).Value = objUpload.Fields(" Number" ).FileName
objRs.Fields(" Street" ).Value = objUpload.Fields(" Street" ).FileName
[color=#CC0000]objRs.Fields(" imagepath" ).Value = strFileName[/color]
objRs.Update

objRs.Close
[color=#CC0000]Set objUpload = Nothing [/color] 
Response.write " Record Added" 
%>


< Message edited by Spooky -- 4/4/2003 1:51 PM >


_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to walrus)
walrus

 

Posts: 542
Joined: 3/13/2003
From: London
Status: offline

 
RE: Match the Face to the Place! - 4/4/2003 13:57:10   
They werent but I thought that might be what you meant so I moved them. Same result.
The error is just..
quote:

The page cannot be displayed
There is a problem with the page you are trying to reach and it cannot be displayed.

--------------------------------------------------------------------------------

Please try the following:

Open the www.londonrent.net home page, and then look for links to the information you want.
Click the Refresh button, or try again later.

Click Search to look for information on the Internet.
You can also see a list of related sites.




HTTP 500 - Internal server error
Internet Explorer

Here are the three pages
Page 1
http://www.londonrent.net/Upload2/helpme1.asp
Page 2
http://www.londonrent.net/Upload2/helpme2.asp
To see the results
http://www.londonrent.net/Upload2/helpme3.asp
The pages you mention are in this folder
Here is the part from the global.asa
Application(" helpme1_ConnectionString" ) = " DRIVER={Microsoft Access Driver (*.mdb)};DBQ=URL=fpdb/helpme1.mdb" 
		FrontPage_UrlVars(1) = " helpme1_ConnectionString" 
		Application(" helpme1_ConnectionTimeout" ) = 15
		Application(" helpme1_CommandTimeout" ) = 30
		Application(" helpme1_CursorLocation" ) = 3
		Application(" helpme1_RuntimeUserName" ) = " " 
		Application(" helpme1_RuntimePassword" ) = " " 


_____________________________

I hope The Boss isn't reading this, ...she thinks I program everything!

(in reply to Spooky)
walrus

 

Posts: 542
Joined: 3/13/2003
From: London
Status: offline

 
RE: Match the Face to the Place! - 4/4/2003 14:05:07   
Should I do this now or wait until the previous error is resolved?

_____________________________

I hope The Boss isn't reading this, ...she thinks I program everything!

(in reply to Spooky)
walrus

 

Posts: 542
Joined: 3/13/2003
From: London
Status: offline

 
RE: Match the Face to the Place! - 4/4/2003 14:33:44   
I made the latest changes but the original error remains.

_____________________________

I hope The Boss isn't reading this, ...she thinks I program everything!

(in reply to Spooky)
Spooky

 

Posts: 26597
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Match the Face to the Place! - 4/4/2003 23:33:04   
There you go - notice the small change to the database fields.
We have to use the different method.

<!--#INCLUDE FILE=" clsUpload.asp" -->
<%
Dim objUpload, strFileName, strPath
Set objUpload = New clsUpload
strFileName = objUpload.Fields(" File1" ).FileName
strPath = Server.MapPath(" fpdb" ) & " \"  & strFileName
objUpload(" File1" ).SaveAs strPath

Set objConn = Server.CreateObject(" ADODB.Connection" )
Set objRs = Server.CreateObject(" ADODB.Recordset" )
objConn.Open Application(" helpme1_ConnectionString" )

objRs.Open " Results" , objConn, 3, 3
objRs.AddNew

objRs.Fields(" Number" ).Value = objUpload.Fields(" Number" ).value
objRs.Fields(" Street" ).Value = objUpload.Fields(" Street" ).value
objRs.Fields(" imagepath" ).Value = strFileName

objRs.Update
objRs.Close
Set objRs = nothing
Set objConn = nothing
Set objUpload = Nothing

Response.write " Record Added" 
%>




_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to Spooky)
walrus

 

Posts: 542
Joined: 3/13/2003
From: London
Status: offline

 
RE: Match the Face to the Place! - 4/5/2003 3:29:01   
I tried these changes but I still haven' t lost the original error. I am thinking it might be a connection error. The page 2 code at the moment looks like this
<!--#INCLUDE FILE=" clsUpload.asp" -->
<%
Dim objUpload
Dim strFileName
Dim strPath
Set objUpload = New clsUpload
strFileName = objUpload.Fields(" File1" ).FileName
strPath = Server.MapPath(" ../fpdb" ) & " \"  & strFileName
objUpload(" File1" ).SaveAs strPath

Set objConn = Server.CreateObject(" ADODB.Connection" )
Set objRs = Server.CreateObject(" ADODB.Recordset" )
objConn.Open Application(" helpme1_ConnectionString" )

objRs.Open " Results" , objConn, 3, 3
objRs.AddNew

objRs.Fields(" Number" ).Value = objUpload.Fields(" Number" ).value
objRs.Fields(" Street" ).Value = objUpload.Fields(" Street" ).value
objRs.Fields(" imagepath" ).Value = strFileName

objRs.Update
objRs.Close
Set objRs = Nothing
Set objConn = Nothing
Set objUpload = Nothing

Response.write " Record Added" 
%>


_____________________________

I hope The Boss isn't reading this, ...she thinks I program everything!

(in reply to Spooky)
Spooky

 

Posts: 26597
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Match the Face to the Place! - 4/5/2003 13:15:01   
strPath = Server.MapPath(" ../fpdb" ) & " \" & strFileName ?

Are you able to use the same code as me by placing the files in the root directory? (except the database)

To show the error : IE > tools > options > advanced > DONT show friendly http errors

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to walrus)
walrus

 

Posts: 542
Joined: 3/13/2003
From: London
Status: offline

 
RE: Match the Face to the Place! - 4/5/2003 14:15:31   
ADODB.Recordset error ' 800a0cc1'

Item cannot be found in the collection corresponding to the requested name or ordinal.

/helpme2.asp, line 20


< Message edited by walrus -- 4/5/2003 3:08 PM >


_____________________________

I hope The Boss isn't reading this, ...she thinks I program everything!

(in reply to Spooky)
Spooky

 

Posts: 26597
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Match the Face to the Place! - 4/5/2003 15:09:01   
Do you have a column named " imagepath" (text) 100 as mentioned above?
You need somewhere to save the image path.

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to walrus)
walrus

 

Posts: 542
Joined: 3/13/2003
From: London
Status: offline

 
RE: Match the Face to the Place! - 4/5/2003 15:19:24   
I had misunderstood the above. Sorry. I now have
Microsoft OLE DB Provider for ODBC Drivers error ' 80004005'

[Microsoft][ODBC Microsoft Access Driver]Error in row

/helpme2.asp, line 22
the code is
<!--#INCLUDE FILE=" clsUpload.asp" -->
<%
Dim objUpload
Dim strFileName
Dim strPath
Set objUpload = New clsUpload
strFileName = objUpload.Fields(" File1" ).FileName
strPath = Server.MapPath(" fpdb" ) & " \"  & strFileName
objUpload(" File1" ).SaveAs strPath

Set objConn = Server.CreateObject(" ADODB.Connection" )
Set objRs = Server.CreateObject(" ADODB.Recordset" )
objConn.Open Application(" helpme1_ConnectionString" )

objRs.Open " Results" , objConn, 3, 3
objRs.AddNew

objRs.Fields(" Number" ).Value = objUpload.Fields(" Number" ).value
objRs.Fields(" Street" ).Value = objUpload.Fields(" Street" ).value
objRs.Fields(" imagepath" ).Value = strFileName

objRs.Update
objRs.Close
Set objRs = Nothing
Set objConn = Nothing
Set objUpload = Nothing

Response.write " Record Added" 
%>


_____________________________

I hope The Boss isn't reading this, ...she thinks I program everything!

(in reply to Spooky)
Spooky

 

Posts: 26597
Joined: 11/11/1998
From: Middle Earth
Status: offline

 
RE: Match the Face to the Place! - 4/5/2003 16:47:40   
In design view of the database, can you ensure that ALL fields allow zero length and are not required?
It may be expecting some input and the database design wont allow it.

_____________________________

If you arent part of the solution, then there is good money to be made prolonging the problem

§þ:)


(in reply to walrus)
Page:   [1] 2   next >   >>

All Forums >> Web Development >> ASP and Database >> Upload file reference to DRW
Page: [1] 2   next >   >>
Jump to: 1





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts