 |
| 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
|
|
|
|

November 21st, 2003, 04:30 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

November 21st, 2003, 05:33 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
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.
|
|

November 21st, 2003, 07:28 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

November 21st, 2003, 10:16 AM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
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.
|
|

November 21st, 2003, 03:06 PM
|
|
Friend of Wrox
|
|
Join Date: Oct 2003
Posts: 702
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

November 22nd, 2003, 10:34 AM
|
|
Friend of Wrox
|
|
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

May 12th, 2004, 12:14 AM
|
|
Registered User
|
|
Join Date: May 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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...
|
|

May 12th, 2004, 08:48 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
"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
|
|
 |