473,386 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

apiCopyFile failure in Access Runtime version

10
Hi, I have installed a runtime version of my Access 2000 programme on a pc (XP OS SP2). I have a button on my main swich menu that is used for the user to backup the database using the apiCopyFile method. This works fine on my development pc but produces a copy failure error on the runtime version,and I cant for the life on me figure this one out. I have also tried to use FileSystem object to no avail (and in fact ran into more issues with that due to the scrrun.dll reference). Does any one have any ideas? Would be much appreciated!

Cheers

Tania
Jun 6 '07 #1
5 2823
ADezii
8,834 Expert 8TB
Hi, I have installed a runtime version of my Access 2000 programme on a pc (XP OS SP2). I have a button on my main swich menu that is used for the user to backup the database using the apiCopyFile method. This works fine on my development pc but produces a copy failure error on the runtime version,and I cant for the life on me figure this one out. I have also tried to use FileSystem object to no avail (and in fact ran into more issues with that due to the scrrun.dll reference). Does any one have any ideas? Would be much appreciated!

Cheers

Tania
What exactly is the Error Description and when does it actually occur?
Jun 6 '07 #2
tan
10
I am getting a file in use error ie 32 using err.lastdllerror at time of copy execution. It's odd because i can copy an open databse in development/ full access but not in the runtim version. I tried copying an unopen file in the runtime version and the apiCopyFile worked fine...its simply to do with not being able to copy an open file and I have no idea how to get around this now!
Jun 6 '07 #3
Lysander
344 Expert 100+
I am getting a file in use error ie 32 using err.lastdllerror at time of copy execution. It's odd because i can copy an open databse in development/ full access but not in the runtim version. I tried copying an unopen file in the runtime version and the apiCopyFile worked fine...its simply to do with not being able to copy an open file and I have no idea how to get around this now!
If its an open file error, then something I used a long time ago might work. I'm afraid I've forgotten the details, but the concept is this.

Instead of running your copy code, run a bit of code that opens a new database called 'BackupSys'. This would close your database and open backupsys whose only code and function would be a startup routine that backed up the now closed database, and then opened it again. When I used this in Access 2.0 I had to make all sorts of windows calls, and sendkeys statements to open the 'backupsys' database but I'm sure later versions of Access have made it simpler.
Jun 6 '07 #4
tan
10
Thats an excellent idea!!! i think it will work...thanks!
Jun 6 '07 #5
ADezii
8,834 Expert 8TB
I am getting a file in use error ie 32 using err.lastdllerror at time of copy execution. It's odd because i can copy an open databse in development/ full access but not in the runtim version. I tried copying an unopen file in the runtime version and the apiCopyFile worked fine...its simply to do with not being able to copy an open file and I have no idea how to get around this now!
There should be no problem with apiCopyFile() copying an Open File so the problem exists somehow with the Runtime Version of Access. Just to verify, try an alternate Method to copy the Open File and let's see how this works:
Expand|Select|Wrap|Line Numbers
  1. Sub CopyFile(SourceFile As String, DestFile As String)
  2. Dim CopyString As String
  3.  
  4. If Dir(SourceFile) = "" Then
  5.   MsgBox Chr(34) & SourceFile & Chr(34) & " is not a valid file name."
  6. Else
  7.   SourceFile = Chr(34) & SourceFile & Chr(34)
  8.   DestFile = Chr(34) & DestFile & Chr(34)
  9.   CopyString = "COMMAND.COM /C COPY " & SourceFile &  " " & DestFile      
  10.     Call Shell(CopyString, 0)
  11. End If
  12. End Sub
NOTE: If you are using Microsoft Windows NT, change the line:
Expand|Select|Wrap|Line Numbers
  1. CopyString = "COMMAND.COM /C COPY " & SourceFile & 
-------------------------------------- TO --------------------------------------
Expand|Select|Wrap|Line Numbers
  1. CopyString = "CMD.EXE /C COPY " & SourceFile & 
Jun 6 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Damaji Jambhale | last post by:
COMException: Catostrphic failure When I added a "dll" reference in the web project. I was able to instantiate the class OK. But when I tried to set the properties, it failed with...
14
by: wolftor | last post by:
1) Is there a free runtime version of Access available that is more recent than the one for Access 2000? 2) If I create an application (MDE) in A2K, will it run on all later versions of Access?...
3
by: Simple Man | last post by:
We have a citrix server that users will be signing into from a remote location. One application is an Access database. Right now, lan users are using the Access 2003 runtime to run these...
0
by: miqbal | last post by:
IM getting this error when i try to run Teecharts ActiveX control in asp.net environment can some one help me in it Regards Moid Iqbal Catastrophic failure Description: An unhandled...
0
by: Hernan Garber | last post by:
Hi, Attached, the installation log. Win 2k Server SP3 IE6SP1/SQL Server Installed Thanks Setup.exe: Setup.exe: ========== Logging started ==========
4
by: brooks | last post by:
I have an Access 97 app and the ADT and am considering selling it to the public. Is this viable? What issues might I have? I also have Access 2000 and could use that if it would be better. I...
5
by: B1ackwater | last post by:
We've fooled around with Access a bit, but only using the single-user store-bought version. It seems to be a good database - versatile and infinitely programmable - and can apparently be used as a...
0
by: Marty Cruise | last post by:
I successfully deploy my application to 20 domain users. Only one new user is giving me a problem, although he can access all domain resources. When he clicks the installation link on the...
17
by: Neil | last post by:
A client of mine likes some of the new bells and whistles in Access 2007, and is thinking about converting our A03 format MDB to an A07 format file. However, while some of the users have A07, many...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.