Reply to Re: Namespaces? Why?

Your name:

Reply:


Posted by Jim Carlock on 10/02/07 22:24

"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)
'Doesn't do much or show much here.
'But if we were to include an oRs As DAO.Recordset we then
'could use the following...
'
'Set oRs = .OpenRecordset(sSQL)
'
'And if so desired, we could return a DAO.Recordset.
End With
Set ConnectToDb = oDb
End Function

Good catch, Steve. I encoded it to confirm it.

--
Jim Carlock
Swimming Pool, Spa And Water Feature Builders
http://www.aquaticcreationsnc.com/

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация