Re: custom class module- in another database



I had posted this question, and was waiting for a response- since it's
similar to the one below (and doesn't use a keyword like 'ABS') I thought you
might have some insight:

Regarding the reply below, I have seen the VB_Creatable/Exposed Attributes,
and I think I was able to modify one or both, making them visible in the OB;
I used a nice utility that exports the class as text, changed the attribute,
and re-imported the class. I believe that this would be ok, and probably
could be automated to update the 200 or so classes that I would need to
change. I have seen this done in another example, but I had lost everthing
in hurricane Katrina (lived in New Orleans), and was not able to ask how it
was being done before the disaster- but I know it works (this was in and
Access '97 DB- I would like to do this same process for 200-2003 version as
well).

However, with that said, I really am searching for a function that will
instantiate required classes on load, and a similar one to release them if
they are not needed, or upon close. Right now, these are basically shared
classes, and functions in modules, that are in a separate MS Access DB. If
you know of a link for such functions, I would appreciate it. Also, is there
any advantage putting them in a library file instead of an .mdb, and would it
eliminate all of the above issues?

Thanks for any help! Steve

"'69 Camaro" wrote:

> Hi, Steve.
>
> The class's VB_Exposed attribute allows other databases to see the class,
> and the VB_Creatable attribute allows other databases to instantiate objects
> from the class. Depending upon which version of Access you are using, even
> if you change the VB_Exposed attribute to allow you to see the class from
> other databases, you may not be able to change the VB_Creatable attribute, so
> won't be able to instantiate the object in another database.
>
> Please see the following Web page for a discussion last year about the pros
> and cons of several different approaches to the problem:
>
> http://groups.google.com/group/microsoft.public.access.modulesdaovba/browse_thread/thread/89cea0834d6bcca9/fac51736f3c70e61?lnk=st&q=reference+class+instantiate+group:microsoft.public.access.*+author:camaro&rnum=1&hl=en#fac51736f3c70e61
>
> HTH.
> Gunny
>
> See http://www.QBuilt.com for all your database needs.
> See http://www.Access.QBuilt.com for Microsoft Access tips.
>
> (Please remove ZERO_SPAM from my reply E-mail address so that a message will
> be forwarded to me.)
> - - -
> If my answer has helped you, please sign in and answer yes to the question
> "Did this post answer your question?" at the bottom of the message, which
> adds your question and the answers to the database of answers. Remember that
> questions answered the quickest are often from those who have a history of
> rewarding the contributors who have taken the time to answer questions
> correctly.
>
>
> "stevemets" wrote:
>
> > I added a reference to another MS Access database, and can use it's objects
> > (forms, code modules, functions, etc.) but the classes in the 2nd database do
> > not even show up in the object browser in the referencing .mdb, let alone
> > allow use of them.
> >
> > How do I instantiate these classes (there are a lot of them- I'd like some
> > way to just instantiate them as needed, or somehow use a function to
> > encapsulate the process so it happens when the referencing DB opens). Any
> > ideas?
> >
> > Thanks!

"Brendan Reynolds" wrote:

>
> 'Abs' is the name of a built-in VBA function. You could either
> 'disambiguate' by specifying your project name in the declaration ...
>
> Dim questionnaire As YourProjectName.Abs
>
> .... or rename your class.
>
> --
> Brendan Reynolds
>
> "rocco" <rocco@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:B74198C4-A8F0-41F0-AE4E-76A705E7BDC7@xxxxxxxxxxxxxxxx
> > Hello,
> > I have built a very small and easy class module for a questionnaire we cal
> > "Abs".
> > I have called the class Abs. Here is the [code] (there is something more
> > but
> > similar):
> >
> > [Option Compare Database
> > Private question As String
> > Private prequestion As String
> >
> > Public Property Get avviso() As String
> > 'ricevo l'avviso che precede la domanda
> > avviso = prequestion
> > End Property
> >
> > Public Property Let avviso(i As String)
> > 'stabilisco l'avviso che precede la domanda
> > prequestion = carica_caption(i)
> > End Property]
> >
> >
> > I'm having trouble instanciating it. i mean: I cannot instanciate it at
> > all!!
> > Once I digit ---> [dim questionnaire as Abs] I get this error message :
> > ----
> > compile error:
> > Expected: New or type Name
> > -------
> > Even if i digit ---> [dim questionnaire as New Abs] I get the msg:
> > compile error:
> > Expected: identifier
> >
> > Why?
> > I can see my Abs object in the Object Browser but cannot instanciate it...
> > Ok, this is my first experience with custom classes after lots of reading.
> > I
> > was expecting troubles... but not so soon!!!!!!!!!!!!!!
>
>
>
.



Relevant Pages

  • DataGrid and Selected Rows
    ... In the form I instantiate a DataTable object. ... I have a DataGrid on the form which is bound to the *second* ... How can I iterate through the rows of the grid and see which ones are ... Keep in mind that the DataGrid is not bound to the Access database, ...
    (microsoft.public.dotnet.framework.adonet)
  • DAO data control or DAO instantiation
    ... that run multiple queries against a database. ... Lately I have seen that most programmers instantiate this when they ... Which is better on memory? ... My question is not just for DAO, ADO also has a data control or I can ...
    (microsoft.public.dotnet.framework.adonet)
  • DAO (Instantiate as Object or use the Data Control)
    ... that run multiple queries against a database. ... Lately I have seen that most programmers instantiate this when they ... Which is better on memory? ... My question is not just for DAO, ADO also has a data control or I can ...
    (comp.databases.ms-access)
  • Re: public abstract static ...
    ... | I don't think it's meaningful to instantiate an instance of an object only ... | public class Customer: EntityBase ... | to get an entity from the database just to be able to delete it. ... Then how about factoring out the retrieval behaviour, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Port forwarding question.
    ... for filemaker pro, for example, is done via the ABS and I can connect to ... it via the internet merely by typing the static ip address: ... if I wanted to connect to another database hosted ... Specify different receiving ports on the ABS to forward the incoming ...
    (comp.sys.mac.advocacy)