FIle Form Element

R

rn5a

I am storing the physical path of images, along with 3 more columns,
in a MS-Access DB table. I want to provide users the option to change
this physical image path (as well as the records in the other columns)
for which I am using the *File* Form element.

The column under which the physical paths are stored is the 4th column
in the DB table.

Users first come to a page that displays the distinct records existing
in column1 in the above mentioned DB table in a dropdown select list.
When an option is selected by the user & the Form is posted, the next
page would retrieve the records from the DB table depending upon what
a user selected from the dropdown select list & display them to the
user in textboxes so that they can edit the records.

<%
Dim objConn
Set objConn=Server.CreateObject("ADODB.CONNECTION")
'ConnectionString
objConn.Open

Dim strSQL
strSQL="SELECT * FROM MyTable WHERE Col1='" &
Request.Form("selectlistvalue") & "'"

Dim objRS
Set objRS=Server.CreateObject("ADODB.RECORDSET")
objRS.Open strSQL,objConn
%>
<form>
<input type=text name="col1" value="<%= objRS("Col1") %>">
<input type=text name="col2" value="<%= objRS("Col2") %>">
<input type=text name="col3" value="<%= objRS("Col3") %>">
<input type=file name="col4" value="<%= objRS("Col4") %>">
</form>

The problem is, unlike the textboxes, the *File* Form field doesn't
display the physical path (Col4) in the textbox that accompanies the
*File* Form element.

Any idea how do I make the textbox in the *File* Form field show the
record from Col4 (i.e. the physical path) from the DB table like how
the other 3 textboxes display their respective records?
 
B

Bob Barrows [MVP]

I am storing the physical path of images, along with 3 more columns,
in a MS-Access DB table. I want to provide users the option to change
this physical image path (as well as the records in the other columns)
for which I am using the *File* Form element.

Not possible. You need to use a textbox..
 
R

rn5a

I am storing the physical path of images, along with 3 more columns,
in a MS-Access DB table. I want to provide users the option to change
this physical image path (as well as the records in the other columns)
for which I am using the *File* Form element.

The column under which the physical paths are stored is the 4th column
in the DB table.

Users first come to a page that displays the distinct records existing
in column1 in the above mentioned DB table in a dropdown select list.
When an option is selected by the user & the Form is posted, the next
page would retrieve the records from the DB table depending upon what
a user selected from the dropdown select list & display them to the
user in textboxes so that they can edit the records.

<%
Dim objConn
Set objConn=Server.CreateObject("ADODB.CONNECTION")
'ConnectionString
objConn.Open

Dim strSQL
strSQL="SELECT * FROM MyTable WHERE Col1='" &
Request.Form("selectlistvalue") & "'"

Dim objRS
Set objRS=Server.CreateObject("ADODB.RECORDSET")
objRS.Open strSQL,objConn
%>
<form>
<input type=text name="col1" value="<%= objRS("Col1") %>">
<input type=text name="col2" value="<%= objRS("Col2") %>">
<input type=text name="col3" value="<%= objRS("Col3") %>">
<input type=file name="col4" value="<%= objRS("Col4") %>">
</form>

The problem is, unlike the textboxes, the *File* Form field doesn't
display the physical path (Col4) in the textbox that accompanies the
*File* Form element.

Any idea how do I make the textbox in the *File* Form field show the
record from Col4 (i.e. the physical path) from the DB table like how
the other 3 textboxes display their respective records?

ADDENDUM:
-------------

The same thing happens if a textbox field is replaced with a textarea
Form element. For e.g. using the following code

<textarea name="col2" col=20 rows=10 value="<%= objRS("Col2") %>"></
textarea>

the textarea remains blank!
 
E

Evertjan.

wrote on 12 mei 2007 in microsoft.public.inetserver.asp.general:
<input type=file name="col4" value="<%= objRS("Col4") %>">
</form>

The problem is, unlike the textboxes, the *File* Form field doesn't
display the physical path (Col4) in the textbox that accompanies the
*File* Form element.

Since the files and the directory layout on my, the client's, machine is
non of your, the server's and the programmer's, business, the powers that
make browsers have rightly thought it fitting that the security regime
prohibits your intent.

Furthermore this is not an ASP serverside problem,
so your quest is off-topic on this NG.

If you want to further your doomed quest,
please do so elsewhere, not on a serverside code NG,
as serverside code like under ASP doesn't know about
<input type='file'>.
 
J

Justin Piper

On May 12, 3:47 pm, (e-mail address removed) wrote:

The same thing happens if a textbox field is replaced with a textarea
Form element. For e.g. using the following code

<textarea name="col2" col=20 rows=10 value="<%= objRS("Col2") %>"></
textarea>

the textarea remains blank!

The textarea element does not have a value attribute. Instead you nest its
content inside the element:

<textarea name="col2" cols="20" rows="10"><%= objRS("Col2")
%></textarea>

You can find documentation for the textarea element as well as other HTML
elemnts on Microsoft's website:

textArea Object
http://msdn2.microsoft.com/en-us/library/ms535904.aspx

HTML Elements
http://msdn2.microsoft.com/en-us/library/ms533029.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top