Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access ASP
| Search | Today's Posts | Mark Forums Read
Access ASP Using ASP with Microsoft Access databases. For Access questions not specific to ASP, please use the Access forum. For more ASP forums, please see the ASP forum category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access ASP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 26th, 2005, 07:20 AM
SKE SKE is offline
Authorized User
 
Join Date: Mar 2005
Location: , , .
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to store a file name in a field ?

Hi ! I need to create a form where I select a file from my hard drive and once pressed the submit botton, an asp form should read my file's name and store it in a DB record.
How can I do this ?!?!
Any help really appreciated !

 
Old April 26th, 2005, 07:32 AM
Friend of Wrox
 
Join Date: Apr 2005
Location: Cochin, , India.
Posts: 186
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I think you looking for the <input type=file> to upload a file

 
Old April 28th, 2005, 12:49 PM
SKE SKE is offline
Authorized User
 
Join Date: Mar 2005
Location: , , .
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

HEY, if I use the "file" type in my form I receive an error in the line referring to my third string. The string I'm referring to is the "strIdArtista" one.
Is that I have to change type of record or something ?!
I think that using the "file" type in the form, it doesn't send the name of the file but tries to send the entire file !

This is my script : (strIdArtista IS THE FILE ONE, the other two are just plain text)

<%
dim strTitolo
strTitolo = request.form("titolo")

dim strArtista
strArtista = request.form("artista")

dim strIdartista
strIdartista = request.form("idartista")

dim strCode
strCode="innovatel"

Set Conn=Server.CreateObject("ADODB.Connection")
strConn="driver={Microsoft Access Driver (*.mdb)}; "
strConn=strConn & " DBQ=" & Server.MapPath("exhibitions.mdb")
strConn=strConn & ";pwd=" & strCode
Conn.Open strConn

sql = "SELECT * FROM exhibitions"

Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open sql, conn ,3,3

rs.addnew
rs(1) = strTitolo
rs(2) = strArtista
rs(3) = strIdartista
rs.update

Response.Write "<html>"
Response.Write "Complimenti. Hai inserito la mostra " & strTitolo & "<br>"
Response.Write "dell'artista " & strArtista & "<br>"
Response.Write "con ID " & strIdartista & "<br>"
Response.Write "</html>"

rs.Close
set rs = Nothing




THANKS A LOT TO ANYONE WHO CAN HELP !

 
Old May 2nd, 2005, 07:09 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Melbourne, Vic, Australia.
Posts: 308
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Like Prashant.k.m said, <input type=file> is used to upload a file.
If you just want the filename, you'll have to do something a bit trickier.
Do you want to store the file or just the name?

Steven


I am a loud man with a very large hat. This means I am in charge
 
Old May 13th, 2005, 06:40 AM
SKE SKE is offline
Authorized User
 
Join Date: Mar 2005
Location: , , .
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi !
I only want to store the file's name. Not the file !!!

 
Old May 13th, 2005, 06:52 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
Default

SKE,

What is the value you have in hand now? Is that the file name that you have with path etc? Can you explain more on that?

_________________________
- Vijay G
Strive for Perfection
 
Old May 14th, 2005, 04:46 AM
SKE SKE is offline
Authorized User
 
Join Date: Mar 2005
Location: , , .
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey, thanks for your help but I found a different solution, first uploading the file and then retrieving its name and writing in in the table. It finally WORKS !!!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Read file and store it to database sparsh2010 Access VBA 3 July 17th, 2008 08:27 AM
store variables from DLL file maxpotters Beginning VB 6 3 August 26th, 2006 05:01 PM
how to store a text file vivekkumar_23 SQL Server 2000 2 July 4th, 2006 09:18 AM
multiple checkbox store one field mateenmohd Classic ASP Basics 0 June 11th, 2006 01:39 AM
how to store text file in database vivekkumar_23 Servlets 1 February 13th, 2006 05:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.