|
-
Apr 17th, 2007, 11:24 AM
#1
Thread Starter
Frenzied Member
Save a form to Access
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 
Thanks
-
Apr 17th, 2007, 01:07 PM
#2
Re: Save a form to Access
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?
-
Apr 17th, 2007, 02:46 PM
#3
Re: Save a form to Access
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 17th, 2007, 04:57 PM
#4
Thread Starter
Frenzied Member
Re: Save a form to Access
 Originally Posted by Hack
Why would you need to do that?
I was just thinking about somewhere to save forms.
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 .....
 Originally Posted by RobDog888
Saving the path to where the form files are stored is preferred.
I did wonder if this was a better option.
If I saved the path to where the form was saved, how would I use the path to restore / open the form?
 Originally Posted by RobDog888
you could safe all the text that defines the form in your table for recreation of the form on the fly
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.
-
Apr 18th, 2007, 07:26 AM
#5
Re: Save a form to Access
If you are looking to provide examples, why not create something like a Word file or a Help file?
-
Apr 18th, 2007, 12:27 PM
#6
Thread Starter
Frenzied Member
Re: Save a form to Access
 Originally Posted by Hack
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.
-
Apr 18th, 2007, 01:05 PM
#7
Re: Save a form to Access
 Originally Posted by aikidokid
I was just thinking about somewhere to save forms.
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
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.
This is easier than creating an actual help file. After this program is in the bag, they may be something to tackle next.
-
Apr 18th, 2007, 01:17 PM
#8
Thread Starter
Frenzied Member
Re: Save a form to Access
 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.
Hey, I like this idea
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 (famous last words )
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?
-
Apr 18th, 2007, 01:31 PM
#9
Re: Save a form to Access
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.
-
Apr 18th, 2007, 01:59 PM
#10
Thread Starter
Frenzied Member
Re: Save a form to Access
 Originally Posted by Hack
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.
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.
-
Apr 18th, 2007, 03:11 PM
#11
Re: Save a form to Access
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.
-
Apr 23rd, 2007, 01:12 PM
#12
Thread Starter
Frenzied Member
Re: Save a form to Access
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.
-
Apr 26th, 2007, 12:29 AM
#13
Re: Save a form to Access
Check RhinoBull's signature for the "how to..." on storing and retrieving objects to an Access db.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Apr 26th, 2007, 03:37 AM
#14
Re: Save a form to Access
http://www.vb-helper.com/howto_database_picture.html
Same technique can be applied for any type of file.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|