 |
| Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the Classic ASP Databases 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
|
|
|
|

May 31st, 2005, 06:22 AM
|
|
Registered User
|
|
Join Date: May 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
script to open db to ms word?
hi, i've been create an upload form to uplad file.
i'm using ASP and MS Access. when i upload file, database just only record the path.
I want the file i've upload may open based on it extension--for my case I'm using ms word-- when I click the path.
anyone can help me, please.
I need this script programming.
|
|

May 31st, 2005, 07:48 AM
|
|
Authorized User
|
|
Join Date: Jul 2004
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Say you are getting the path of the uploaded file into the variable fname. You can write the following to display a hyperlink for the user to download the file.
<%
Response.write "<a href=" & fname & ">Click to Open</a>"
%>
Regards
Raj
|
|

June 1st, 2005, 10:57 AM
|
|
Registered User
|
|
Join Date: May 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
g, thanks for comment.
I've try your suggest, but it doesn't work.
this is for detail.
I'm using ASP script to stored file in database which is MS Access.
Ms Access stored file formed as path. just only path. for example D:\weedee\Doc1.doc
when I open browser e.g IE. it shows the records that I stored in database for example D:\weedee\Doc1.doc
how do I write the script to open this records according to it extension when i clicked it on?
|
|

June 1st, 2005, 12:55 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
WeeDee,
Where do you upload the files to? How do you store the path in the DB?
You should not use absolute reference(viz "D:\weedee\doc1.doc") for storing path in db. Use relative reference (viz "weedee/doc1.doc") to get that to work. Also remember, you upload the files to some folder under your website. Say your website is hosted under "D:\wwwroot\weedee\", then, you may upload the folders to some where within "D:\wwwroot\weedee\Documents" and the path in the DB should show something like "/documents/doc1.doc", which should be fetched from the db and shown as href part for the link.
Hope that helps.
Cheers!
_________________________
- Vijay G
Strive for Perfection
|
|

June 2nd, 2005, 02:15 PM
|
|
Registered User
|
|
Join Date: May 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
well, I think it was a lil'bit mistakes. I forgot to say that I'm using ASPSimpleUpload. the vFolder created as "uploads/" under c:\wwwroot\inetpub\ta_asp5 . it was success to store file in that folder but I can't see the record in my database. I'm using the script below :
<%
set conn = server.createobject("ADODB.connection")
conn.open "dee", "",""
sqlrekord = "select dok from tablestoring"
set rekord = server.createobject("ADODB.Recordset")
rekord.open conn,sqlrekord
%>
it will save a file into field dok, but when I combine with ASPSimpleUpload script the file cannot saved into field dok.
it sound dumb, but I really really confuse. can you tell me how the steps to save file in "uploads/" folder and field dok at the same time. and then get the file when it clicked as shown in a browser
|
|

June 2nd, 2005, 04:40 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post
|
|
I haven't used "ASPSimpleUpload" yet, so I cannot comment on that. May be you can refer to the site from where you downloaded that for details on the same in integration into your code.
Cheers!
_________________________
- Vijay G
Strive for Perfection
|
|
 |