By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,631 Members | 1,144 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,631 IT Pros & Developers. It's quick & easy.

FIle Form Element

P: n/a
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?

May 12 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On May 12, 3:47 pm, r...@rediffmail.com wrote:
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!

May 12 '07 #2

P: n/a
rn**@rediffmail.com wrote:
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..

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
May 12 '07 #3

P: n/a
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'>.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
May 12 '07 #4

P: n/a
On Sat, 12 May 2007 06:37:33 -0500, <rn**@rediffmail.comwrote:
On May 12, 3:47 pm, r...@rediffmail.com 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
--
Justin Piper
Bizco Technologies
http://www.bizco.com/
May 14 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.