Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / September 2005

Tip: Looking for answers? Try searching our database.

Help !! VBA code to copy

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chase - 30 Sep 2005 09:29 GMT
I am using Access 2003 running as 2000. My PC OS is Win XP Pro on a Windows
2003 network.

The following is two versions of the VBA code I have on a Form the first is
on the local PC "C:\" drive and works the second is on a net work driv a
generates the following error:-
"Error No: 3734; Description: The database has been plased in a stste by
'Admin' on machine 'WS-XP-018' that prevents it from being opened r locked."

First Version that works

Private Sub cmdExpSum_Click()
On Error GoTo ErrorHandler
Dim StrPath As String
Dim StrRegion As String

   StrPath = "C:\VolumeDatabase\Reports\" & txtFileName & ".xls"
   StrRegion = ("qctb" & Forms![frmReportOps]![cboRegion])
   DoCmd.SetWarnings False
   Me.Form.Requery
   DoCmd.CopyObject "C:\VolumeDatabase\ProcessReport.mdb", StrRegion,
acQuery, "qctbSummary"
   DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, StrRegion,
StrPath, True
   DoCmd.DeleteObject acQuery, StrRegion
   DoCmd.SetWarnings True
   
ErrorHandlerExit:
   Exit Sub

ErrorHandler:
   MsgBox "Error No: " & Err.Number & "; Description: " & _
       Err.Description
   Resume ErrorHandlerExit

End Sub

Second Version that does not work

Private Sub cmdExpSum_Click()
On Error GoTo ErrorHandler
Dim StrPath As String
Dim StrRegion As String

   StrPath = "\\admiral-srv1\data\VolumeDatabase\Reports\" & txtFileName &
".xls"
   StrRegion = ("qctb" & Forms![frmReportOps]![cboRegion])
   DoCmd.SetWarnings False
   Me.Form.Requery
   DoCmd.CopyObject "\\admiral-srv1\data\VolumeDatabase\ProcessReport.mdb",
StrRegion, acQuery, "qctbSummary"
   DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel9, StrRegion,
StrPath, True
   DoCmd.DeleteObject acQuery, StrRegion
   DoCmd.SetWarnings True
   
ErrorHandlerExit:
   Exit Sub

ErrorHandler:
   MsgBox "Error No: " & Err.Number & "; Description: " & _
       Err.Description
   Resume ErrorHandlerExit

End Sub

PLEASE HELP
Ofer - 30 Sep 2005 11:24 GMT
The first thing I would do, is check the permissions on the network drive,
try and create a text file in it, to see if you have permissions.
Not the MDB, the directory you are copying data to.
Signature

I hope that helped
Good luck

> I am using Access 2003 running as 2000. My PC OS is Win XP Pro on a Windows
> 2003 network.
[quoted text clipped - 63 lines]
>
> PLEASE HELP
Chase - 30 Sep 2005 15:21 GMT
Ofer

Outputing the fexcel spreadsheet from the database to the server works fine
it is the copying of an object within the database that is the problem.

> The first thing I would do, is check the permissions on the network drive,
> try and create a text file in it, to see if you have permissions.
[quoted text clipped - 67 lines]
> >
> > PLEASE HELP
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.