473,406 Members | 2,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

FIle Form Element

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
4 2038
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Gregg | last post by:
Hello all, I have been banging my head over a problem that I am having reading a comma seperated file (CSV) that can contain from 1 to 10,000 records. My code snipit is as follows: **Start...
1
by: mattrapoport | last post by:
I have a form with an input type='file' element. I click on the Browse button of my file upload element, select a file, and hit open. The file name appears in the textbox portion of the file...
1
by: Andy Wells | last post by:
I'm using VB.NET and I have an application that binds a schema to the main form's controls, and the user has the ability to load an XML file through the schema and into the bound form. My...
2
by: mark | last post by:
How do I detect that a particular form element is a file upload or if the file upload has worked? In the Python cgi module documentation I found suggested code... form = cgi.FieldStorage()...
1
by: hardik | last post by:
can anyone tell me how i can change the filename which is going to uploaded here is a code for uploading a file <!-- #include file="clsUpload.asp" --> Set objUpload = New clsUpload If...
3
by: forest demon | last post by:
for example, let's say I do something like, System.Diagnostics.Process.Start("notepad.exe","sample.txt"); if the user does a SaveAs (in notepad), how can i capture the path that the user...
13
by: Bill Nguyen | last post by:
Is it possible to create your won XSD to use with .NET based on an XML content? For example the one below: <?xml version="1.0"?> <pcats:FuelsDoc...
6
by: ramg80 | last post by:
Hi, I m using ajax to upload a file. I m using servlets (MultipartFormDataRequest) to upload the file. My script contains the form data and the file. I m able to get the values of the form...
1
by: Sebarry | last post by:
Hi, I'm using the following code from the-stickman.com to create a file upload list in Javascript. I want to modify it so that the file element is only added if the user has provided a description...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.