I am trying to construct a 'Copy' statement in Access 2000 vb that I will actually write out to create a .bat file. My problem is that I need to put quotes around the vcFileFrom and vcFileTo (“vcFileFro m” and “vcFileTo” ) to be able to handle having spaces in the file name. I just can not seem to get the correct syntax in my access vb code to get the quotes around the filenames.
I have the following code:
OutRec = "Copy " & vcFileFrom & ", " & vcFileTo & ""
The result of this is:
OutRec = Copy C:\Data\From\DB .mdb, U:\Data\TO\DB.m db
What I need the results to be is:
OutRec = Copy “C:\Data\F rom\D B.mdb”, “U:\Data\T O\D B.mdb”
(having the space in the .mdb name).
The first copy statement works as long as my file name does not contain any spaces. So, I am trying to change the copy statement to be able to handle files with spaces.
Can anyone tell me how to get the quotes wrapped around my “FromFile” and “ToFile” variables when trying to build the syntax? I’ve tried several ways and cannot get it to work.
Thanks!
I have the following code:
OutRec = "Copy " & vcFileFrom & ", " & vcFileTo & ""
The result of this is:
OutRec = Copy C:\Data\From\DB .mdb, U:\Data\TO\DB.m db
What I need the results to be is:
OutRec = Copy “C:\Data\F rom\D B.mdb”, “U:\Data\T O\D B.mdb”
(having the space in the .mdb name).
The first copy statement works as long as my file name does not contain any spaces. So, I am trying to change the copy statement to be able to handle files with spaces.
Can anyone tell me how to get the quotes wrapped around my “FromFile” and “ToFile” variables when trying to build the syntax? I’ve tried several ways and cannot get it to work.
Thanks!
Comment