VB6 / Access 2002 / ADO
Is it possible to save an actual 'VB form' to a database?
Or would I have to save a path to a folder where it could be stored?
Any ideas would be great :D
Thanks
Printable View
VB6 / Access 2002 / ADO
Is it possible to save an actual 'VB form' to a database?
Or would I have to save a path to a folder where it could be stored?
Any ideas would be great :D
Thanks
:confused: Save the physical form itself?
Why would you need to do that?
You can save a physical file to a database as a BLOB (Binary Large Object) and retrieve it again. But, once retrieved, what would you do with it?
Saving the path to where the form files are stored is preferred. You wont overcomplicate your code, you wont over bloat your databaase, safe against db corruption loss of your form data, etc.
Or you could safe all the text that defines the form in your table for recreation of the form on the fly. Just have to figure out the resx files as they may have to be stored on the file system or in the db.
I was just thinking about somewhere to save forms.Quote:
Originally Posted by Hack
I have various examples of how to do things on some forms, and I thought that it might be a good idea to have these examples saved all in the one place, and as I am writing a Code Library .....
I did wonder if this was a better option.Quote:
Originally Posted by RobDog888
If I saved the path to where the form was saved, how would I use the path to restore / open the form?
Again, I did think of this option, but it would probably be my second choice, but probably only because the other option has the form all ready to use, and hopefully it won't be too hard to do and use. ;)Quote:
Originally Posted by RobDog888
If you are looking to provide examples, why not create something like a Word file or a Help file?
Could you expand on that a little bit.:)Quote:
Originally Posted by Hack
As you come across these take a screen shot, dump it to a Word document, type in whatever directions you think would be helpful regarding the screen shot, and then have your program open this document whenever the user (in this case, you :) ) needs to.Quote:
Originally Posted by aikidokid
This is easier than creating an actual help file. After this program is in the bag, they may be something to tackle next.
Hey, I like this idea :cool:Quote:
Originally Posted by Hack
So, save the word document to the database.
Then, when the user (me :) ) clicks on the relevent node, it open a word document.
Sounds fairly simple :cool: (famous last words :lol:)
Does Access save documents with pictures in it just as a straight forward document?
I have read different articles about how to save images to a database.
How straight forward is this?
I was actually referring to saving the Word document to disk and calling it from your program.
However, you could save it to your database. I've never done this with Access, but I have with both SQL Server and Oracle. Saving files directly into a database is a topic covered in our Database FAQs.
I know I am writing this program just for me to use but it was and is also a learning process as well.Quote:
Originally Posted by Hack
What do you think of this idea:
Save two files to the database.
First could contain any code for the form, in the same way all my other code is stored.
Secondly, save the Word document to the database.
Then when I click on the relevant node, the code is opened in the code library window, and an instance(?) of MS Word is opened and displays the saved word document, with images etc.
Apart from me learning new things with VB, would this be a viable option.
I don't want to do something if it's not necessarily the best way. :ehh:
Sometimes, for some examples it is usefull if you store the files.
You can store a form in access in a BLOB field. (same way you store a picture in access. google for code.)
You could tell the user to select the folder containing the project/form files (or individual files). Then zip them using zlib library and store in access blob field as an attatchment.
When user wants to open the file, unzip it in Temp folder and ShellExecute the vbp or frm file.
You'll need to store frx files too.
You could also open the project file in text mode and from there you can get the list of frm/mod/cls files you need to store.
iPrank, I am interested in this approach, although it may be a bit advanced for me at the moment. :)
At the moment I am looking into the suggestion by Hack, using a screenshot and saving it in MS Word.
Could you expand on this a bit on how I would start to go about writing this.
I am not after the code, just the way and order to start writing something like this.
I wouldn't be storing many forms in the DB, so size isn't going to be a problem, and the program is for me to use so I can do this whatever way works for me. :)
Check RhinoBull's signature for the "how to..." on storing and retrieving objects to an Access db.
http://www.vb-helper.com/howto_database_picture.html
Same technique can be applied for any type of file.