[dba-VB] Importing VB6 cls file as Class Module in Access VBA

Borge Hansen pcs.accessd at gmail.com
Thu May 1 07:08:11 CDT 2008


Hi guys,
I was going to just say please disregard my post...

But this is what happened:
I have this HTTPClass.cls from http://www.paradoxes.info/code/HTTPClass.html

We are using it to send data across the internet to a service provider who
does Text To Speech (TTS) for us, then sends out phone calls, receives the
keys press feed back from the clients - which in turn is sent back to us via
another process ... used for identifying short term relief staff to fill
short term vacancies in different industries ....

So far I had been using the properties from a .dll created on the class and
referenced into the VBA project.

Questions came up about the format of the parameters we are sending across,
so I had to start look into this thing and pick out the string that is
actually being sent.
So I thought I try and import the .cls into a class module and run the class
in the VBA project so I can debug.print the POSTDATA string of the
SendRequest function... (see the code on the website...)

To answer your question:
I did Insert > ClassModule > Pasted the Code from HTTPSClass.cls > Compiled
Code > Saved the Class Module

No problems!

What prompted my question was that I had opened the .cls file in
VisualStudio and it had added the Version and Attribute lines I was having
problem with - which turns out is not part of the original .cls file and is
totally unnecessary ..

John and Shamil, thanks for responding...

regards
borge

On Thu, May 1, 2008 at 9:27 PM, Shamil Salakhetdinov <
shamil at smsconsulting.spb.ru> wrote:

> John,
>
> May I argue that Borge just needs to get VB6 code reused (copied and
> pasted)
> in his VBA project? Let's ask Borge?
>
> Thanks.
>
> --
> Shamil
>
> -----Original Message-----
> From: dba-vb-bounces at databaseadvisors.com
>  [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of jwcolby
> Sent: Thursday, May 01, 2008 3:10 PM
> To: Discussion concerning Visual Basic and related programming issues.
> Subject: Re: [dba-VB] Importing VB6 cls file as Class Module in Access VBA
>
> Shamil,
>
> If you notice the Exposed and creatable properties, it appears that he
> is trying to make the class viewable from outside of a library.  Just
> deleting those lines will prevent that.
>
> He needs to do the Insert Class, Insert file thing.
>
> John W. Colby
> www.ColbyConsulting.com <http://www.colbyconsulting.com/>
>
>
> Shamil Salakhetdinov wrote:
> > Hi Borge,
> >
> > Just remove these lines, which do not compile - those are attributes
> used
> > internally by VB6: VBA has some similar attributes but you usually do
> not
> > need to change them from within VBA's IDE....
> >
> > --
> > Shamil
> >
> > -----Original Message-----
> > From: dba-vb-bounces at databaseadvisors.com
> > [mailto:dba-vb-bounces at databaseadvisors.com] On Behalf Of Borge Hansen
> > Sent: Thursday, May 01, 2008 11:33 AM
> > To: dba-vb at databaseadvisors.com; accessd at databaseadvisors.com
> > Subject: [dba-VB] Importing VB6 cls file as Class Module in Access VBA
> >
> > Hi there,
> >
> > I am swimming in the deep end of the pool and threading water so to
> speak
> > .... I need help!
> >
> > I have imported a VB6 .cls file into VBA
> >
> > The following shows up in red and will not compile
> >
> > 'Will not compile :
> > VERSION 1.0 CLASS
> >
> >  Attribute VB_Name = "HTTPClass"
> > Attribute VB_GlobalNameSpace = False
> > Attribute VB_Creatable = True
> > Attribute VB_PredeclaredId = False
> > Attribute VB_Exposed = True
> > 'End of lines not compiling
> >
> > Here is the beginning of the module - it's the HTTPClass.cls from
> available
> > from some VB6 website, can't remember the link right now ...;
> > all other code lines appear ok in VBA
> >
> > What do I need to do??
> >
> >
> >
> > '**** Beginning of VBA Class Module ::
> > Option Compare Database
> > Option Explicit
> > VERSION 1.0 CLASS
> > BEGIN
> >   MultiUse = -1  'True
> >   Persistable = 0  'NotPersistable
> >   DataBindingBehavior = 0  'vbNone
> >   DataSourceBehavior = 0   'vbNone
> >   MTSTransactionMode = 0   'NotAnMTSObject
> > End
> > Attribute VB_Name = "HTTPClass"
> > Attribute VB_GlobalNameSpace = False
> > Attribute VB_Creatable = True
> > Attribute VB_PredeclaredId = False
> > Attribute VB_Exposed = True
> >
> > Public Enum ePort
> >    INTERNET_DEFAULT_HTTP_PORT = 80
> >    INTERNET_DEFAULT_HTTPS_PORT = 443
> > End Enum
> > ...
> >
> >
> > Regards
> > borge
> > _______________________________________________
> > dba-VB mailing list
> > dba-VB at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/dba-vb
> > http://www.databaseadvisors.com
> >
> > _______________________________________________
> > dba-VB mailing list
> > dba-VB at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/dba-vb
> > http://www.databaseadvisors.com
> >
> >
> _______________________________________________
> dba-VB mailing list
> dba-VB at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-vb
> http://www.databaseadvisors.com
>
> _______________________________________________
> dba-VB mailing list
> dba-VB at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/dba-vb
> http://www.databaseadvisors.com
>
>



More information about the dba-VB mailing list