August 21, 2003 at 12:48 am
How can I store Excel / word / Image documents in SQL server 2000. The files exists on the NT server. What should be the front end to browse the files and capture into the SQL server database. The front end given to the users is the I.E using ASP. Pl. guide.
Thanks
chitra
August 21, 2003 at 1:11 am
Hi chitra,
quote:
How can I store Excel / word / Image documents in SQL server 2000. The files exists on the NT server. What should be the front end to browse the files and capture into the SQL server database. The front end given to the users is the I.E using ASP. Pl. guide.
you need an image column in your table and some experience with the ADO Stream Object (if you decide you use a small VB app to bring this data into SQL Server) or use the textcopy tool that comes along with SQL Server.
In your ASP page you need somethin like the following to retrieve the data and present it to the user
SQL="SELECT img FROM " & lpszTableName & " WHERE id=" & lpszMsgID
oRecSet.Open SQL, oConn
If oRecSet.BOF And oRecSet.EOF Then
Response.End
End If
Response.ContentType = "application/vnd.ms-excel"
Response.BinaryWrite oRecSet.Fields("img")
Simply change the content type to the appropriate file format to display pdf's, doc's, xls'....
Anyway, this assumes that the file extensions are linked to the corresponsing programs, that need to be installed on the client machine
Cheers,
Frank
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
August 21, 2003 at 3:29 am
As an alternative, consider using NTFS to store the document files. In your database simply store a pointer to the resource, e.g. a varchar field called "URI",
containing data such as:
"//myarchiveserver/myfiles$/myfile.xls"
You don't say what version of IE, but assuming something fairly modern with the appropriate plugins, displaying the documents is then as simple as redirecting the browser window/frame to the URI.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply