Problem Copying Access 2.0 database in VB3 
Author Message
 Problem Copying Access 2.0 database in VB3

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?

Thanks

Doug




Sun, 07 Feb 1999 03:00:00 GMT  
 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....




Mon, 08 Feb 1999 03:00:00 GMT  
 Problem Copying Access 2.0 database in VB3

Try also setting the db variable to nothing as in

set db=nothing

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?

> Thanks

> Doug





Tue, 09 Feb 1999 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. VB3, Copy Queries from Access 2.0 Database

2. Accessing Access 2.0 database with VB3, ODBC 2.0 and Microsotf Jet Engine Compatibility Layer

3. Help: Problem reading Access 2.0 mdb from VB3 under Win95/Access 7.0

4. Problems accessing Access 2.0 via ODBC 2.x from VB3.0

5. changinf tabledef on access 2.0 database using vb3.0 pro and comp layer

6. Urgent : REPAIR DATABASE Method ( VB3.0 and Access 2.0 )

7. Copying Access 2.0 Database.

8. Copying structure of Access 2.0 database

9. Problems accessing ACCESS 2.0 databases from ODBC

10. VB3 and Access 2.0 problem

11. VB3 - Access 2.0 Compat Layer compact problem

12. Help with VB3/Access 2.0 problem PLEASE!!!

 

 
Powered by phpBB® Forum Software