473,394 Members | 2,168 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Public definitions in module - VS 2005

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

Aug 4 '06 #1
5 1103
On Fri, 4 Aug 2006 14:45:55 -0700, "Henry Jones" <he********@yada.comwrote:
>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
Aug 4 '06 #2
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.
"gene kelley" <ok**@by.mewrote in message
news:l6********************************@4ax.com...
On Fri, 4 Aug 2006 14:45:55 -0700, "Henry Jones" <he********@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

Aug 4 '06 #3
On Fri, 4 Aug 2006 15:53:54 -0700, "Henry Jones" <he********@yada.comwrote:
>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
Aug 4 '06 #4
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" <he********@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

Aug 5 '06 #5
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

"GhostInAK" <gh*******@gmail.comschreef in bericht
news:c7**************************@news.microsoft.c om...
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" <he********@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


Aug 5 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Raymond Tinsel | last post by:
Hello all, I know this must be a newbie question, but I haven't found the solution in the tutorials I have read. For a dSPACE/Controldesk application I am defining several of my own modules....
4
by: test1dellboy3 | last post by:
Hi, I am a beginner using the python interpreter. To reduce typing effort, I created a module called "aliases.py" containing some aliases for objects I commonly use like - aliases.py : ...
5
by: cFleury | last post by:
Hi, I have a public structure which is initialized only at startup time but at least one of the elements of this structure is losing its value, this particular element is ONLY initialized at the...
2
by: Hexman | last post by:
Well, back for another question. I'm doing some calculations in a module (the reason in a module is because it is an I-O module - reading csv files, Access DB, etc.). (If not in a Module, where...
8
by: Thelma Lubkin | last post by:
I have finally nagged more work out of the non-profit organization that I'm trying to do volunteer work for. The following code begins a tiny form that is part of the project that I'll be...
2
by: Henry Jones | last post by:
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...
15
by: esha | last post by:
I need to have a Public variable in my project. In VB it can be declared in a standard module. Where can I do it in C# ? I tried to do it in default class Program.cs and I tried it in an added by...
36
by: zouyongbin | last post by:
Stanley B Lippman in his "C++ Primer" that a definition like this should not appear in a header file: int ix; The inclusion of any of these definitions in two or more files of the same...
3
by: =?Utf-8?B?QW5kcmVhcw==?= | last post by:
If i click on the function "Collapse to definitions" ALL the collapsable elements in the source become collapsed. This is a bug, then it is not correct. If you do it in c# 2005, then namespace...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.