Createdatabase and TransferDatabase

T

Tracey

We have an Access application running on a server. users connect via CITRIX.
One function creates a new database on the user's local machine and then
exports a table into it using the TransferDatabase method. this was working
perfectly in Access 2000. We upgraded to Access 2003 and now we are getting
errors, "cannot open file" , "do not have persmissions" or "file is corrupt".
Any suggestions? I have searched the forums and the web. Tried several things
and nothing seems to be working. Below is the code I am using:

Private Sub CreateNewAccessDB()
Dim wrkDefault As Workspace
Dim dbsNew As Database

Set wrkDefault = DBEngine.Workspaces(0)

If Len(Dir$("C:\Reports\*.*", vbDirectory)) = 0 Then
MkDir ("C:\Reports")
End If

If Dir("C:\Reports\AccessExtract.mdb") <> "" Then Kill
"C:\Reports\AccessExtract.mdb"

Set dbsNew = wrkDefault.CreateDatabase("C:\Reports\AccessExtract.mdb",
dbLangGeneral, dbVersion10)
DoCmd.TransferDatabase acExport, "Microsoft Access",
"C:\Reports\AccessExtract.mdb", acTable, "qryName", "qryName_" &
DateValue(Now()), 0
dbsNew.Close

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top