ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old August 4th, 2003, 01:40 AM
shalee shalee is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 22 shalee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
download files from database

do anyone knows how to download files from database to a certain path...using asp and sql server 7...plz help

Reply With Quote
  #2  
Old August 4th, 2003, 03:12 AM
sunway sunway is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 0 sunway User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Dim sServer,sDBName,sUsername,sPassword
Dim strConn,strSQL,objConn,objRS

sServer="Your Server Name"
sDBName = "Your Database Name"
sUsername = "Your User Name"
sPassword = "Your Password"

strConn = "Provider=sqloledb;Data Source=" & sServer & ";Initial Catalog=" & sDBName & ";User Id=" & sUsername & ";Password=" & sPassword

Set objConn = Server.CreaeObject("Adodb.Connection")
objConn.Open strConn
'for example.your table have two fields.they are "download_fiel_Id" and "download_file_path".
Set objRS = objConn.Execute("SELECT * FROM [your table] WHERE id=" & download_file_id)
If Not objRS.Eof Then
Response.Redirect objRS("download_file_path")
Else
Response.Write ("file not found!")
End If

objConn.Close
Set objConn = Nothing

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > download files from database


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway