Posted by Steve on 10/02/07 22:38
"Jim Carlock" <anonymous@127.0.0.1> wrote in message
news:4702c543$0$20585$4c368faf@roadrunner.com...
> "Steve" wrote...
> : i think he meant the DAO used in the 'with' statement...
> : which is NOT a namespace but an object instance. i believe
> : his code sample above would fail anyway since i don't recall
> : DAO being a static class - static was introduced to vb in
> : vb.net.
>
> You're right. I've got to use a user-defined type, object or
> Variant with the With statement.
>
> Private Function ConnectToDb(sFQFN As String) As DAO.Database
> Dim oDb As DAO.Database
>
> With oDb
> Set oDb = DAO.OpenDatabase(sDb)
btw, you don't need to use DAO.OpenDatabase unless you have another class
with the same interface...which is 'collision'. even though you specify
DAO.OpenDatabase and avoid the collision, it only resembles namespaces here
because you are trying to acheive the same thing as a namespace. however, i
have to keep saying, they are NOT the same.
make sense?
[Back to original message]
|