|
-
Jan 24th, 2000, 03:13 PM
#1
Thread Starter
Member
I am in dire need of knowing the syntax for copying files thru VB
i am trying to incorporate a backup function for the database and need to know how to copy it to another file
i also need to know if it is possibe to automate a mail merge thru VB but thats not really a major issue in the program
thanks in advance for any help available
-
Jan 24th, 2000, 03:33 PM
#2
So Unbanned
look at the filecopy funtion in help
------------------
DiGiTaIErRoR
VB, QBasic, Iptscrae, HTML
Quote: There are no stupid questions, just stupid people.
-
Jan 24th, 2000, 03:41 PM
#3
Thread Starter
Member
You mean, as in the MSDN stuff??
i dont Have the MSDN libraries, company copy, small machine, no room, no cd
does anyone have an example of filecopy code?
-
Jan 24th, 2000, 05:06 PM
#4
Member
I think u will b ... good luck
Sub CopyFile(SourceFile As String, DestFile As String)
FileCopy SourceFile, DestFile
End Function

------------------
BlackRose
-
Jan 24th, 2000, 05:12 PM
#5
Member
if u need something more Pro. try this API
yeh ... I like this one 
Create a module and type the following lines in the Declarations section:
Option Explicit
Declare Function apiCopyFile Lib "kernel32" Alias "CopyFileA" _
(ByVal lpExistingFileName As String, _
ByVal lpNewFileName As String, _
ByVal bFailIfExists As Long) As Long
Type the following procedure:
Sub CopyFile(SourceFile As String, DestFile As String)
'---------------------------------------------------------------
' PURPOSE: Copy a file on disk from one location to another.
' ACCEPTS: The name of the source file and destination file.
' RETURNS: Nothing
'---------------------------------------------------------------
Dim Result As Long
If Dir(SourceFile) = "" Then
MsgBox Chr(34) & SourceFile & Chr(34) & _
" is not valid file name."
Else
Result = apiCopyFile(SourceFile, DestFile, False)
End If
End Sub
To test this procedure, type the following line in the Immediate window, and then press ENTER:
CopyFile "<pathNorthwind.mdb>", "C:\Northwind.mdb"
------------------
BlackRose
-
Jan 24th, 2000, 06:41 PM
#6
Thread Starter
Member
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
|