Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
| Search | Today's Posts | Mark Forums Read
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 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 November 21st, 2003, 04:30 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Cairo, , Egypt.
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default images and Textfiles are on server

hi all,
do any one have a solution... how do i deal with images and files stored on a SQL-Server Machine in specific folder, i have a table with their paths.. do any have a solution how to get them to view on a client machine using either vb6,vb.net.




Ahmed Ali
Software Developer
__________________
Ahmed Ali
Senior Software Developer
 
Old November 21st, 2003, 05:33 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Unless your "client machine" is the machine with SQL server on it you'll have to do some fancy SQL programming to pull in the file so you can deliver it to a data consumer via a SQL connection. That's not exactly not what SQL is built for. There is file import functionality in data transformation services in MSSQL but I don't know how easy it would be to work with single files, usually you use those utilities for importing data files. But I suppose you could import a file as if it just had one field and one row.

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old November 21st, 2003, 07:28 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Cairo, , Egypt.
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default

thx planoie for reply,
the idea is that these images and files are much and huge in size , so it's easy for me not to store them in a the database so i have just stored their paths...also my server for security reasons i stop files and folder sharing services.
so i could only talk to sqlserver

so is there sample codes for that
Need Comments







Ahmed Ali
Software Developer
 
Old November 21st, 2003, 10:16 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

I don't know how you would do this in SQL off hand, never had to do this.

Is the machine running SQL have IIS and some page processor (ASP, ASP.Net,PHP, etc.) available? This kind of thing would be very easy to do in an environment like that, and the file can be served up over HTTP instead of having to route it through SQL.

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old November 21st, 2003, 03:06 PM
sal sal is offline
Friend of Wrox
 
Join Date: Oct 2003
Location: Clarksville, TN, USA.
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What are you using for front end? I have done this with Access and there is an easy trick to retrieve them. hint, use a hyperlynk in a form. One line of code needed.

me.label1.HyperlinkAddress = "\\Servername\" & rs!FieldName

Field name would be the field where you store the path. I never keep the ComputerName in my path (in case those networking people decide to re-name the computers...again.)

This will open any file regardless of what the file type is.



Sal
 
Old November 22nd, 2003, 10:34 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Cairo, , Egypt.
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default

hi again,
my front end is VB used to connect SQLSERVER,what i need is to get files in temperory opened Binary file , planoie mention me that DTS could be done with so if any have done before and have sample code, or link Plz help.

dear sal
i think i cant's get files like you mention coz i disable filesharing on the server,,, i need to talk with sqlServer
 
Quote:
quote:What are you using for front end? I have done this with Access and there is an easy trick to retrieve them. hint, use a hyperlynk in a form. One line of code needed.
Quote:

me.label1.HyperlinkAddress = "\\Servername\" & rs!FieldName

Field name would be the field where you store the path. I never keep the ComputerName in my path (in case those networking people decide to re-name the computers...again.)

This will open any file regardless of what the file type is.
Ahmed Ali
Software Developer
 
Old May 12th, 2004, 12:14 AM
Registered User
 
Join Date: May 2004
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi

I have a similar problem. I am using vb6 & sql server. I have provided the provision to the users for uploading the file of any type through my project. I upload the file by saving the contents of file in sql server in field of 'image' datatype. I can read the contents of file & download it too on the client machine, if the user opts so by clicking on the button. The user can save the file on his hard-disk & open 'n' view the file.
What I want is when the user clicks on the button... the file should open up automatically rather than being saved on the machine. The file uploaded in the sql server can be of any type .doc, .exe,.gif etc. I don't know how to open up the file in the concerned program automatically when the user clicks the button.

Please help...
 
Old May 12th, 2004, 08:48 AM
Friend of Wrox
Points: 3,489, Level: 24
Points: 3,489, Level: 24 Points: 3,489, Level: 24 Points: 3,489, Level: 24
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Central, NJ, USA.
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

"Hello", this would be a function of your HTML/ASP page in sending the proper headers to the user. You might want to ask this in another forum that deals with those issues.

Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee




Similar Threads
Thread Thread Starter Forum Replies Last Post
[VB2005]Import textfiles to Excel using QueryTable bellaelysium Visual Studio 2005 0 July 28th, 2008 01:32 AM
multiple textfiles to one textfile for import Marleen Access VBA 5 September 28th, 2006 09:03 AM
images in sql server rj1406 ASP.NET 1.0 and 1.1 Basics 1 September 28th, 2004 05:50 AM
uploading images to server joseph007 Classic ASP Components 0 September 16th, 2004 08:30 AM





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