|
-
Jul 21st, 2003, 09:47 AM
#1
Thread Starter
Member
How to Create a Directory
Hello...
How to create a directory at runtime... with the name given in textbox... in the app.path...
and how to create the database.. douplicate.... (dump).... in that new (created) folder...
thanks in advance...
-
Jul 21st, 2003, 09:51 AM
#2
Frenzied Member
-
Jul 21st, 2003, 11:38 AM
#3
Addicted Member
try the following code and reply
to create a directory runtime:
mkdir app.path & "\" & text1.text
-
Jul 21st, 2003, 11:45 AM
#4
Frenzied Member
VB Code:
Public Sub subCreateFolger(PathName As String)
If Right(PathName, 1) = "\" Then
PathName = Left(PathName, Len(PathName) - 1)
End If
Dim Curdirname As String
On Local Error GoTo ErrHandler
Curdirname = CurDir
ChDir PathName
ChDir Curdirname
Exit Sub
ErrHandler:
If Err = 76 Then
MkDir PathName
Resume Next
End If
Resume Next
End Sub
oh1mie/Vic

-
Jul 22nd, 2003, 12:52 AM
#5
Thread Starter
Member
Thanks
Thank you very much... for your guidence...
It is working perfectly... as I wished...
and is there any way to overwrite an existing directory...?
if the directory already exists... it should be removed with confirmation... and new one should be created...
[ is there any way to Delete a directory thru vb program...?]
And one more thing i would like to ask... that...
i am having a file... named "project.mdb" in the app.path.
i want to copy the file in to newly created directory...
in current directory there is a file project.mdb
i want to create new directory...
let us suppose... MyDir, this directory should consists of project.mdb file.
waiting for reply...
-
Jul 22nd, 2003, 01:53 AM
#6
Thread Starter
Member
I got it
Hai...
I got the answer to my question...
it is nothing but... Filecopy method.
i.e.
SourceFile as string
DestinationFile as string
FileCopy SourceFile, DestinationFile
--------------------------------------------------------
FileCopy "C:\abc.txt", "C:\Temp\abc.txt"
--------------------------------------------------------
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
|