views:

103

answers:

1

Hi I am developing a software with vb6.0 :( . I wanna to know that what the best code for saving a file in SQL server and then reading from it is?

I should say that I use ADODB.Stream when saving file.....

what is you suggestion?

+1  A: 

Do you need to save to sql. An alternative, and IMO better solution is to save the docs to a folder on your regular file system and save the reference to it in sql. Unless you have specific reason for wanting to save in sql?

Is there a specific reason you need to use vb6. Legacy?

Here is an example in .NET on achieving what you require, it should be pretty straightforward to convert to VB6

http://www.jstawski.com/archive/2007/05/17/save-documents-with-sql-server-and-display-them.aspx

UPDATE: With VB6 an example using ADODB.Stream to store and retrieve images, which should be similar to what you need:

http://www.devx.com/tips/Tip/14246

Stuart
Thanks, Yeah, I have to complete an old system which has beed developed by vb6.0. Any suggestion in vb6.0?
odiseh
What about the suggestion of saving files to your regular file system? Is that not an option?
Stuart
Stuart, Thank you very much...
odiseh