|
-
Apr 27th, 2003, 10:35 AM
#1
Thread Starter
Registered User
Working with SaveFileDialog. [Resolved]
I want to export my database file using SaveFileDialog. This database file is working in the background. It is not seen when the program is running.
From the SaveFileDialog, I can only set the destination of the file to be saved, right?
How can I set the source of the file to be saved?
Can I do it on the SaveFileDialog's property window?
Please guide. Thank you.
Last edited by albertlse; Aug 21st, 2003 at 08:03 PM.
-
Apr 27th, 2003, 11:12 AM
#2
Sleep mode
I assume you are going to save the file (any file) where your exe is running (you can change this though) .
VB Code:
Private sub SaveMe()
dim pth As String = Application.StartupPath
SaveDig.Filter = "Rich Text Format|*.rtf"
SaveDig.InitialDirectory = pth
SaveDig.FileName = ""
If SaveDig.ShowDialog = DialogResult.OK Then
'Now you set the destination
FilName = SaveDig.FileName
'here's an example
RichTextBox1.SaveFile(FilName)
MessageBox.Show("File was saved successfully")
End If
-
Apr 28th, 2003, 02:56 AM
#3
Thread Starter
Registered User
I think you had mistaken what I really want.
I'm trying to save a backup of my "database.mdb" file to a new location.
For example: My source file is at "C:\database.mdb".
It is opened when the program is running, and it works in the background.
By opening the SaveFileDialog, I can enter the filename, and select the location where I want to save the backup file to.
How can I do so with SaveFileDialog?
Please let me know if you are still not clear.
-
Apr 28th, 2003, 03:25 AM
#4
Fanatic Member
//How can I set the source of the file to be saved?
This is done entirely through code and has nothing whatsoever to do with SaveFileDialog. That's what Pirate was trying to show you with:
RichTextBox1.SaveFile(FilName)
-
Apr 28th, 2003, 03:39 AM
#5
Sleep mode
That's right . I just wanted to show you how to set the path and then use SaveFile property of the richtextbox . You still have the option of copying the file to the destination but the file must be locked (closed) .
-
Apr 28th, 2003, 10:33 PM
#6
Thread Starter
Registered User
So what I was thinking all the while is true. SaveFileDialog is only used to set the destination of the file to be saved.
To set a source file (database file), how can I do?
-
Apr 28th, 2003, 10:40 PM
#7
Sleep mode
Originally posted by albertlse
So what I was thinking all the while is true. SaveFileDialog is only used to set the destination of the file to be saved.
To set a source file (database file), how can I do?
It's shown in the code I posted above !
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
|