Thanks a lot, just what I needed.
I'll be getting back to that site often.
Three matters though:
1. In the Function fDBExclusive(), the line
Dim db As Database
gives "User-defined type not defined"
I commented out the line where this function is called, don't really need
it, and it all worked just fine; still, how can it be fixed?
2. My database is split, thus it also has a *_be.mdb file which need to
be copied as well. Am I right thinking the actual file copy is made by the
line
lngRet = apiSHFileOperation(tshFileOp)
using the filenames etc specified by the tshFileOp right above it?
I suppose I can just insert this part once more, with the -be.mdb names
instead, right?
3. The Function fCurrentDBDir() is not called (could be useful at other
points though).
Sverk
"Alex Dybenko" skrev:
In-line

Signature
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no private e-mails, please)
> Thanks a lot, just what I needed.
> I'll be getting back to that site often.
[quoted text clipped - 5 lines]
> I commented out the line where this function is called, don't really need
> it, and it all worked just fine; still, how can it be fixed?
Database is a DAO object. By default, Access 2002 uses ADO.
With any code module open, select Tools | References from the menu bar,
scroll through the list of available references until you find the one for
Microsoft DAO 3.6 Object Library, and select it. If you're not going to be
using ADO, uncheck the reference to Microsoft ActiveX Data Objects 2.1
Library
If you have both references, you'll find that you'll need to "disambiguate"
certain declarations, because objects with the same names exist in the 2
models. For example, to ensure that you get a DAO recordset, you'll need to
use Dim rsCurr as DAO.Recordset (to guarantee an ADO recordset, you'd use
Dim rsCurr As ADODB.Recordset)
The list of objects with the same names in the 2 models is Connection,
Error, Errors, Field, Fields, Parameter, Parameters, Property, Properties
and Recordset
> 2. My database is split, thus it also has a *_be.mdb file which need
> to
[quoted text clipped - 5 lines]
> I suppose I can just insert this part once more, with the -be.mdb names
> instead, right?
To copy multiple files, separate the file names with vbNullChar, and put an
extra vbNullChar at the end, as in:
.pFrom = CurrentDb.Name & vbNullChar & _
strBackendDatabase & vbNullChar & vbNullChar
> 3. The Function fCurrentDBDir() is not called (could be useful at
> other
> points though).
You're right.
> Sverk
Sverk - 05 Feb 2006 21:54 GMT
Hi,
I tried to include the back-end file the way I said in my point 2, and it
worked OK, but your way seems smarter, and probably handles flags and errors
better than my way.
I'll see about the DAO vs. ADO later.
Thanks a lot,
Sverk
"Douglas J. Steele" skrev:
> In-line
>
[quoted text clipped - 49 lines]
>
> > Sverk