Connection Fails?

  • Thread starter Thread starter JWR
  • Start date Start date
J

JWR

Hi all,
I am trying to track down a connection problem.

VB.NET
SQL2000
ADO.NET

When running the application I get an error say that "the connection string
is empty". I am declaring the variable that holds the connection string in
a Module : Friend ConnStr$ = ""

A dialog box pops up, by design, that allows one to enter login/pwd info and
connect to this SQL Server. This works fine. This box pops up after the
initial error message. Everything after the initial error message runs
great!

I tried debugging and stepping into and over the code but this error pops up
before the code even starts. None of this type of programming is new to me
yet I can't for the life of me understand, or find, where this error is
coming from. If I initialize the ConnStr$ = "<connection string stuff>",
then I do not see an error.

Any ideas where to look would be appreciated.
Thanks,
John.
 
What is the error message?

Debug the entire app.
Start with Sub Main and step through it until you get the error.

In my module I have:
Public connString As String

When the user clicks my Log-On button I compute the string based on their
input values:
connString = "data source=" & Me.txtServer.Text & ";initial catalog=" &
Me.txtDatabase.Text & ";user id=" & Me.txtUID.Text & ";password=" &
Me.txtPwd.Text & ";Connect Timeout=10"
 
The exact error message is: "System Error: The ConnectionString property
has not been initialized."

I have tried starting with Sub Main; but the error comes up before Sub Main
starts. That's one of the strange things I can't figure out?
 
Back
Top