Home All Groups Group Topic Archive Search About

Public definitions in module - VS 2005

Author
4 Aug 2006 9:45 PM
Henry Jones
I posted in dotnet.general but I think this is a better place to post a VB
question.



I created a module in VS 2005 - Visual Basic Windows Project.

I declared  two strings public

Public strConn as string
Public strSQL as string


When I tried to use these variables in my form, they haven't been defined.
What is the difference between VS 2005 and VS 2003?  I did the same thing is
VS 2003 and everything worked.

Thanks

Author
4 Aug 2006 10:49 PM
gene kelley
Show quote Hide quote
On Fri, 4 Aug 2006 14:45:55 -0700, "Henry Jones" <henryjo***@yada.com> wrote:

>I posted in dotnet.general but I think this is a better place to post a VB
>question.
>
>
>
>I created a module in VS 2005 - Visual Basic Windows Project.
>
>I declared  two strings public
>
>Public strConn as string
>Public strSQL as string
>
>
>When I tried to use these variables in my form, they haven't been defined.
>What is the difference between VS 2005 and VS 2003?  I did the same thing is
>VS 2003 and everything worked.
>
>Thanks
>
>

The statements as posted are apparently OK otherwise you would get the error, "strConn Not
Declared".

By "Not Defined", I'm guessing that you have not initialized values for the variables.

Gene
Author
4 Aug 2006 10:53 PM
Henry Jones
I goofed in what I stated.  When I tried to use the variables in my form, I
received an error message saying that the variables were not declared.


Show quoteHide quote
"gene kelley" <o***@by.me> wrote in message
news:l6j7d29ds2scd5r8qvdij7310jgmnhs37u@4ax.com...
> On Fri, 4 Aug 2006 14:45:55 -0700, "Henry Jones" <henryjo***@yada.com>
> wrote:
>
>>I posted in dotnet.general but I think this is a better place to post a VB
>>question.
>>
>>
>>
>>I created a module in VS 2005 - Visual Basic Windows Project.
>>
>>I declared  two strings public
>>
>>Public strConn as string
>>Public strSQL as string
>>
>>
>>When I tried to use these variables in my form, they haven't been defined.
>>What is the difference between VS 2005 and VS 2003?  I did the same thing
>>is
>>VS 2003 and everything worked.
>>
>>Thanks
>>
>>
>
> The statements as posted are apparently OK otherwise you would get the
> error, "strConn Not
> Declared".
>
> By "Not Defined", I'm guessing that you have not initialized values for
> the variables.
>
> Gene
Author
5 Aug 2006 12:05 AM
gene kelley
On Fri, 4 Aug 2006 15:53:54 -0700, "Henry Jones" <henryjo***@yada.com> wrote:

>I goofed in what I stated.  When I tried to use the variables in my form, I
>received an error message saying that the variables were not declared.
>
>

If you added a Module to you app, added the variables and it looks like:

Module Module1

    Public strConn As String
    Public strSQL As String

End Module

There is no reason that I can think of that "not declared' would show other than typo's.

Gene
Author
5 Aug 2006 7:41 AM
GhostInAK
Hello gene,

It could be possible that the module is in a different namespace than the
code which is trying to use it.
If this is so, add the proper Imports.

-Boo

Show quoteHide quote
> On Fri, 4 Aug 2006 15:53:54 -0700, "Henry Jones" <henryjo***@yada.com>
> wrote:
>
>> I goofed in what I stated.  When I tried to use the variables in my
>> form, I received an error message saying that the variables were not
>> declared.
>>
> If you added a Module to you app, added the variables and it looks
> like:
>
> Module Module1
>
> Public strConn As String
> Public strSQL As String
> End Module
>
> There is no reason that I can think of that "not declared' would show
> other than typo's.
>
> Gene
>
Author
5 Aug 2006 4:23 PM
Michel Posseth [MCP]
> It could be possible that the module is in a different namespace than the
> code which is trying to use it.
> If this is so, add the proper Imports.
>
> -Boo


i would like to add to this , that you can test this easily as a module
behaves as a class with all members declared as shared

see if you can see the members with the modulename   like this
modulename.strConn

regards

Michel Posseth



Show quoteHide quote
"GhostInAK" <ghosti***@gmail.com> schreef in bericht
news:c71747b42b2ca8c88636a81a94e8@news.microsoft.com...
> Hello gene,
>
> It could be possible that the module is in a different namespace than the
> code which is trying to use it.
> If this is so, add the proper Imports.
>
> -Boo
>
>> On Fri, 4 Aug 2006 15:53:54 -0700, "Henry Jones" <henryjo***@yada.com>
>> wrote:
>>
>>> I goofed in what I stated.  When I tried to use the variables in my
>>> form, I received an error message saying that the variables were not
>>> declared.
>>>
>> If you added a Module to you app, added the variables and it looks
>> like:
>>
>> Module Module1
>>
>> Public strConn As String
>> Public strSQL As String
>> End Module
>>
>> There is no reason that I can think of that "not declared' would show
>> other than typo's.
>>
>> Gene
>>
>
>