|
| |
|
|
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!
|
|
|
|
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!
|
|
|
|
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!
|
|
|
|
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!
|
|
|
|
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!
|
|
|
|
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!
|
|
|
|
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!
|
|
|
|
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!
|
|
|
|
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!
|
|
|
|
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!
|
|
|
|
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!
|
|
|
|
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!
|
|
|
|
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!
|
|
|
|
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!
|
|
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
|
|
|