Link to home
Start Free TrialLog in
Avatar of Joar
Joar

asked on

How to save and read files stored as FileStream in SQL Server 2008 from MS Access 2007 vba ?

I have an Access 2007 as frontend to a SQL Server 2008 db.
I want to store and read files into the db using the FILESTREAM way in SQL Server 2008.
I know how to configure the DB for using FileStream.
But I cannot find any code examples on how to deliver parameters from Access (2007) vba to a SQL Server proc, when I want to store a file and when I want to read back that file and display it to the user (files may be of different types: .doc, .pdf, .xls...).

All the code examples I find are describing the way of doing it in .NET code.

Second:
The reason for chosing FileStream as a method, rather than saving the files in a directory with ordinary file save, is a question of  security.
With ordinary file save, I seeem not to be able to restrict the user from deleting and changing files in that directory (the Access app needs the users file access level to be able to store files (?)
With FileStream I understand that the users will not have access to FileStream directory?
Am I wright?
Avatar of Nico Bontenbal
Nico Bontenbal
Flag of Netherlands image

Are you still looking for a solution. I'm thinking about trying to use the information from this article:
http://www.sqlservercentral.com/Forums/Topic243427-169-1.aspx
Or did you try this approach already?
Avatar of Joar
Joar

ASKER

No, thank you. I will have a look at your link.
Good luck and please post your results here, it's a useful technique.
Avatar of Joar

ASKER

I have read the article and it feeded me some new knowledge, so thank for that, but:

It starts as I do with an access vba question, but ends up with the .net solution for communication with the SQL server on the aspect of reading and storing documents through the SQL server FILSTREAM method?

So my question is still:
1. how do I give a document from access vba to the SQL server for saving in the db using the FILSTREAM method
2. how do I read back that same doc in access vba to display it for the user or do somethimg else with it?
ASKER CERTIFIED SOLUTION
Avatar of Nico Bontenbal
Nico Bontenbal
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Joar

ASKER

Just PERFECT!
Thanks a lot!