Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Exporting data to a thumb drive

Status
Not open for further replies.

WyoProgrammer

Technical User
May 13, 2005
25
US
I have a recipe program that I would like to export the recipe file to a thumbdrive using a common dialog box. I have done some research and know I need to use commondialog1.showsave which brings up the window where one can select the thumbdrive but not sure how to actually do the save. I also discovered that the name of the file can be placed in the save as box by the commond commondialog1.filename = "Recipes". Any help or directions would be appreciated.
 
The dialog is just a sort of "file picker" thing, it doesn't save anything by itself. You could just as eaasily present a TextBox to the user and require the full file path to be manually entered. The results are the same, afterward you have a file name to use.

After that is it up to additional code to actually open the file, write to it, and close it.
 
Do you have a suggestion for a forum that is meant to assist the less technical user with such questions?
 
a1vbcode.com
codingforums.com
daniweb.com
developerfusion.com
dreamincode.net
forums.codeguru.com
vb6.us
vbforums.com

I knew my old bookmark archive would come in handy some day :D

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum
 
I'd have to say vbforums.com and xtremevbtalk.com are the two largest sites, though vbforums.com is the far more active of the two. The others listed above have their points as well.
 
Its not 'exclusibely' for professionals although most of the answerers assume you know a fair bit of the basics of vb6.

The commondialog does save the file when you click on Save! That's what it is there for.

Showsave just shows the commondialog screen. The actual saving is done when you click on Save

Read the vb6 help example on commondialog

One annoying thing is when you open it, you first get the folder you last used if the thumbdrive is not inserted before hand or you dont enter it's driver letter in a init dir line before opening it.
 
The commondialog does save the file when you click on Save! That's what it is there for.

Sorry, but that isn't true at all. It merely returns with the chosen path and file NAME for your code to save the data to.
 
I was able to resolve this on my own through some help given by somebody on another, less pompous forum. I am indeed not a professional programmer, merely a hobbyist but I have been doing this for about 20 years now and have written a couple dozen programs that work well, even one which we use in the Clerk of District Court's Office where I work. Everything I know I either taught myself through reading and research or from advice given by more experienced folks. I am now using a forum that is geared more towards the hobbyist. By the way tedsmith, I already knew that all that happened when returning from the drivebox was a knowledge of the drive chosen. I discovered how to do the save and the program is working as intended now.
 
What I meant was the Commondialog system does save IF you use it as suggested in the example in the help disk.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top