A global variable is one that is declared outside of any sub or function, i.e. in the prologue section of the module.
Whereas most languages would assume that a variable so declared is "private (to the module) unless explicitly declared global," Visual Basic makes exactly the opposite assumption and provides a private keyword to declare otherwise. (Yet... variables use public! Go figure...)
The "rather loosy-goosy" (imho) handling of variables in the Visual Basic language can be (again, imho) quite problematic. The declaration option explicit is, yet again imho, quite essential. Otherwise, "tpyos" simply become new variables, not typos!
Create a module (usually referred to as a standard code module) and under the "General" "Declarations" insert something like:
Public gstrConnectionString As String
Make sure to have a naming convention that is documented. Also, make sure that globals are necessary - they are nasty creatures.
Option explicit makes variable declarations mandatory. Without it, you could type in a variable name that was not exactly like the one you declared and vb would make that "new" variable a variant. If you follow any type of naming convention, you will have a mix of upper/lower case characters in your declarations - such as iCounter (mean an integer that will be used as a counter). So I always make sure that programmers who are using vb, make sure that when referencing a declared variable to type it in all lowercase - because when you hit enter, if vb finds a match it will automatically convert that name to its declared name (mix of upper/lower characters). If you do not see that happen, then you know it is a typo or was never declared.