
Problem Copying Access 2.0 database in VB3
Quote:
>I am trying copy an access database to a notebook in VB3.
>I am able to copy the .MDB file to a floppy and then from the floppy to
>the notebook.
>The problem is...
>Set db = OpenDatabase (...,"ODBC")
> .
> .
> .
>db.close
>FileCopy <.MDB>, "a:.MDB"
>..and I get a sharing/write protect violation
>Does anyone know how to close the MDB file properly so that the FileCopy
>won't fail?
First off, with Access 2 and VB 3, you don't need the ODBC.
Second, if you are really trying to do the copy immediately after
copying, JET probably hasn't had time to really close the database.
Throw a Freelocks and a doEvents(or 3) between the two. Try to give
JET time to work before trying to copy the file.
Might also try Set DB = Nothing to free up all links to the database.
If you are using datacontrols though, all bets are off.
Frank....