Hi

I have still not been able to sort out the issue of a non-development machine not being able to open a connection to an SQL database.

Aaron, if you read this thanks for any help you can/could give me

The details are as below

My connection code is (using VB.net):

myConnection = New SqlConnection("data source=SPEEDY;initial catalog=OpsAdminTest;integrated security=True"

MessageBox.Show("connection string: " + myConnection.ConnectionString
MessageBox.Show("myConnection.Database: " + myConnection.Database
MessageBox.Show("myConnection.DataSource:" + myConnection.DataSource
MessageBox.Show("myConnection.Workstationid:" + myConnection.WorkstationId
Tr
myConnection.Open(
Catch ex As Exceptio
MessageBox.Show("Error opening connection"
End Tr
MessageBox.Show("finished initialization"

This is done immediately after the InitializeComponent() call in the application

When I compile/release the code for installation and then install on the same machine that I developed it on, it works fine.
But when I install on the non-development machine, it fails to open the connection

>Are you using DSN, if so, is there an appropriate DSN connection on the non development machine

The non-development machine has the SystemDSN connection to the OpsAdminTest database as it is an active database that we use for test developement of other services. My company does interactive voice services for various tv/radio/magazines and we use SQL to maintain the services

>Are you using Windows or SQL authentication

We are using windows authentication for the SystemDSN connection to the database

>Have you used SQL Profiler to see if you are even touching the SQL server

Sorry this question eludes my limited knowledge. How would I use SQL Profiler in my code to see if I am connection to the server

Again, thanks for any help

Re: Still unable to connect to SQL database on non-development machine by Gerry

Gerry
Mon Apr 26 06:43:22 CDT 2004

I do believe if you are using a DSN, then your connection string should
simply say;

myConnection = "DSN=Speedy"

If that is your DSN.

I have to ask if Speedy is the local SQL server on the development machine
or if it is another server.

--
Gerry O'Brien
Visual Developer .NET MVP
Visual Basic


"debbie" <anonymous@discussions.microsoft.com> wrote in message
news:E1B9C801-91FE-460E-BC82-0B353F23D3D5@microsoft.com...
> Hi,
>
> I have still not been able to sort out the issue of a non-development
machine not being able to open a connection to an SQL database.
>
> Aaron, if you read this thanks for any help you can/could give me.
>
> The details are as below:
>
> My connection code is (using VB.net):
>
> myConnection = New SqlConnection("data source=SPEEDY;initial
catalog=OpsAdminTest;integrated security=True")
>
> MessageBox.Show("connection string: " +
myConnection.ConnectionString)
> MessageBox.Show("myConnection.Database: " + myConnection.Database)
> MessageBox.Show("myConnection.DataSource:" +
myConnection.DataSource)
> MessageBox.Show("myConnection.Workstationid:" +
myConnection.WorkstationId)
> Try
> myConnection.Open()
> Catch ex As Exception
> MessageBox.Show("Error opening connection")
> End Try
> MessageBox.Show("finished initialization")
>
> This is done immediately after the InitializeComponent() call in the
application.
>
> When I compile/release the code for installation and then install on the
same machine that I developed it on, it works fine.
> But when I install on the non-development machine, it fails to open the
connection.
>
> >Are you using DSN, if so, is there an appropriate DSN connection on the
non development machine?
>
> The non-development machine has the SystemDSN connection to the
OpsAdminTest database as it is an active database that we use for test
developement of other services. My company does interactive voice services
for various tv/radio/magazines and we use SQL to maintain the services.
>
> >Are you using Windows or SQL authentication?
>
> We are using windows authentication for the SystemDSN connection to the
database.
>
> >Have you used SQL Profiler to see if you are even touching the SQL
server?
>
> Sorry this question eludes my limited knowledge. How would I use SQL
Profiler in my code to see if I am connection to the server?
>
> Again, thanks for any help.
>



Re: Still unable to connect to SQL database on non-development machine by anonymous

anonymous
Mon Apr 26 07:36:02 CDT 2004

Hi Gerry

>"I have to ask if Speedy is the local SQL server on the development machine or if it is another server.

Thanks for replying. SPEEDY is a separate SQL server.

>I do believe if you are using a DSN, then your connection string shoul
simply say

myConnection = "DSN=Speedy

So I should change my code as follows

myConnection = NewSqlConnection("DSN=Speedy"
myConnection.Database = "OpsAdminTest

Thanks for the help.

Re: Still unable to connect to SQL database on non-development machine by anonymous

anonymous
Mon Apr 26 07:56:05 CDT 2004

Gerry

Just able to try your suggestion (myConnection = "DSN=SPEEDY") and it failed to run on the development machine.

Also, as the myConnection.Database property is read only I can't set the value to be the Database name we need which is OpsAdminTest. We have different databases that do different things. So, for development we use OpsAdminTest, when we go live with a service/application, we would use OpsAdmin

Any other suggestions?

Re: Still unable to connect to SQL database on non-development machine by Gerry

Gerry
Mon Apr 26 10:11:11 CDT 2004

Sorry, forgot to tell you that the Speedy in the DSN=Speedy, should be the
name of the DSN, not the server. My mistake.



--
Gerry O'Brien
Visual Developer .NET MVP
Visual Basic


"debbie" <anonymous@discussions.microsoft.com> wrote in message
news:7105C358-23DC-4B23-A94F-EA9843C2EFAD@microsoft.com...
> Gerry,
>
> Just able to try your suggestion (myConnection = "DSN=SPEEDY") and it
failed to run on the development machine.
>
> Also, as the myConnection.Database property is read only I can't set the
value to be the Database name we need which is OpsAdminTest. We have
different databases that do different things. So, for development we use
OpsAdminTest, when we go live with a service/application, we would use
OpsAdmin.
>
> Any other suggestions?



Re: Still unable to connect to SQL database on non-development machine by anonymous

anonymous
Mon Apr 26 11:01:09 CDT 2004

Tried using the following connection strings and results as indicated

1st entry: This is my original connection string
myConnection = New SqlConnection("data source=SPEEDY;initial catalog=OpsAdminTest;integrated security=True"

Connects correctl

2nd attempt: Modified with your suggestions

myConnection = New SqlConnection("data source=OpsAdminTest;initial catalog=OpsAdminTest"

Fails to connect to database

So, it appears that the only way to connect to the server is by using the 1st connection string. Any other ideas/suggestions?

Re: Still unable to connect to SQL database on non-development machine by Gerry

Gerry
Mon Apr 26 15:12:35 CDT 2004

No, you need to have a DSN created on the machine that will be using the
program that points to the correct datasource.

One of the problems with DSNs is distribution of apps that use them. The
configuration can be hard to get right.

Let's simplify it and stick with your original connection string.

One of the first things I would check next is to verify that the computer
with the app installed, that is not the dev machine, can actually resolve
the computer name of SPEEDY. If you cannot find the computer on the
network, then the connection string will fail for sure.

If you are using TCP/IP as the protocol, on the client machine, type in PING
SPEEDY and see if you return an IP address. if so, then you are resolving
the name correctly and there is likely an authentication issue.

What is the exact error message you are receiving on the client?

--
Gerry O'Brien
Visual Developer .NET MVP
Visual Basic


"debbie" <anonymous@discussions.microsoft.com> wrote in message
news:E7DA03B4-D9E7-468A-AD44-9785D47A5132@microsoft.com...
> Tried using the following connection strings and results as indicated:
>
> 1st entry: This is my original connection string.
> myConnection = New SqlConnection("data source=SPEEDY;initial
catalog=OpsAdminTest;integrated security=True")
>
> Connects correctly
>
> 2nd attempt: Modified with your suggestions.
>
> myConnection = New SqlConnection("data source=OpsAdminTest;initial
catalog=OpsAdminTest")
>
> Fails to connect to database.
>
> So, it appears that the only way to connect to the server is by using the
1st connection string. Any other ideas/suggestions?



Re: Still unable to connect to SQL database on non-development machine by anonymous

anonymous
Tue Apr 27 02:51:03 CDT 2004

The client machine can see the server. Pinging Speedy returns an IP address. We use the OpsAdminTest database to do development work on our IVR system. So, as the client machine is within the IT department, it has access to the database currently through Access using a System DSN.

The error message I get is: Error opening connectio

from the "Catch as Exception section at the start (immediately after the Initialise Component() call.

Is there any other way to test the actual error return code so that we can see it

thanks

----- Gerry O'Brien [MVP] wrote: ----

No, you need to have a DSN created on the machine that will be using th
program that points to the correct datasource

One of the problems with DSNs is distribution of apps that use them. Th
configuration can be hard to get right

Let's simplify it and stick with your original connection string

One of the first things I would check next is to verify that the compute
with the app installed, that is not the dev machine, can actually resolv
the computer name of SPEEDY. If you cannot find the computer on th
network, then the connection string will fail for sure

If you are using TCP/IP as the protocol, on the client machine, type in PIN
SPEEDY and see if you return an IP address. if so, then you are resolvin
the name correctly and there is likely an authentication issue

What is the exact error message you are receiving on the client

--
Gerry O'Brie
Visual Developer .NET MV
Visual Basi


"debbie" <anonymous@discussions.microsoft.com> wrote in messag
news:E7DA03B4-D9E7-468A-AD44-9785D47A5132@microsoft.com..
> Tried using the following connection strings and results as indicated
>> 1st entry: This is my original connection string
> myConnection = New SqlConnection("data source=SPEEDY;initia
catalog=OpsAdminTest;integrated security=True"
>> Connects correctl
>> 2nd attempt: Modified with your suggestions
>> myConnection = New SqlConnection("data source=OpsAdminTest;initia
catalog=OpsAdminTest"
>> Fails to connect to database
>> So, it appears that the only way to connect to the server is by using th
1st connection string. Any other ideas/suggestions




Re: Still unable to connect to SQL database on non-development machine by Gerry

Gerry
Tue Apr 27 06:18:20 CDT 2004

Well, the exception class has numerous properties that will return
information to you. You can use MessageBox.Show or Debug.Writeline, your
choice, and gain access to the properties in this manner.

Try
DB connection code here
Catch ex as Exception
MessageBox.Show(ex.Message) or you can use ErrorCode, InnerException or
Source.

Now, Exception is just a plain Exception object but each one of the data
providers has its own exception properties.

--
Gerry O'Brien
Visual Developer .NET MVP
Visual Basic


"debbie" <anonymous@discussions.microsoft.com> wrote in message
news:4318C5E6-D3BF-4B0D-80AB-82DCD3BBE206@microsoft.com...
> The client machine can see the server. Pinging Speedy returns an IP
address. We use the OpsAdminTest database to do development work on our IVR
system. So, as the client machine is within the IT department, it has
access to the database currently through Access using a System DSN.
>
> The error message I get is: Error opening connection
>
> from the "Catch as Exception section at the start (immediately after the
Initialise Component() call.
>
> Is there any other way to test the actual error return code so that we can
see it?
>
> thanks.
>
> ----- Gerry O'Brien [MVP] wrote: -----
>
> No, you need to have a DSN created on the machine that will be using
the
> program that points to the correct datasource.
>
> One of the problems with DSNs is distribution of apps that use them.
The
> configuration can be hard to get right.
>
> Let's simplify it and stick with your original connection string.
>
> One of the first things I would check next is to verify that the
computer
> with the app installed, that is not the dev machine, can actually
resolve
> the computer name of SPEEDY. If you cannot find the computer on the
> network, then the connection string will fail for sure.
>
> If you are using TCP/IP as the protocol, on the client machine, type
in PING
> SPEEDY and see if you return an IP address. if so, then you are
resolving
> the name correctly and there is likely an authentication issue.
>
> What is the exact error message you are receiving on the client?
>
> --
> Gerry O'Brien
> Visual Developer .NET MVP
> Visual Basic
>
>
> "debbie" <anonymous@discussions.microsoft.com> wrote in message
> news:E7DA03B4-D9E7-468A-AD44-9785D47A5132@microsoft.com...
> > Tried using the following connection strings and results as
indicated:
> >> 1st entry: This is my original connection string.
> > myConnection = New SqlConnection("data source=SPEEDY;initial
> catalog=OpsAdminTest;integrated security=True")
> >> Connects correctly
> >> 2nd attempt: Modified with your suggestions.
> >> myConnection = New SqlConnection("data source=OpsAdminTest;initial
> catalog=OpsAdminTest")
> >> Fails to connect to database.
> >> So, it appears that the only way to connect to the server is by
using the
> 1st connection string. Any other ideas/suggestions?
>
>
>



Re: Still unable to connect to SQL database on non-development machine by anonymous

anonymous
Tue Apr 27 08:11:05 CDT 2004


Thanks, Gerr

The MessageBox.Show(ex.Message) response was

"The .Net Data SQL Provider (System.Data.SqlClient) requires Microsfot Data Access Components(MDAC) version 2.6 or later.

I will try to download and install this component on the client machine. If this fails to correct the problem, I will let you know

I appreciate all the help you have given me

debbi

----- Gerry O'Brien [MVP] wrote: ----

Well, the exception class has numerous properties that will retur
information to you. You can use MessageBox.Show or Debug.Writeline, you
choice, and gain access to the properties in this manner

Tr
DB connection code her
Catch ex as Exceptio
MessageBox.Show(ex.Message) or you can use ErrorCode, InnerException o
Source

Now, Exception is just a plain Exception object but each one of the dat
providers has its own exception properties

--
Gerry O'Brie
Visual Developer .NET MV
Visual Basi


"debbie" <anonymous@discussions.microsoft.com> wrote in messag
news:4318C5E6-D3BF-4B0D-80AB-82DCD3BBE206@microsoft.com..
> The client machine can see the server. Pinging Speedy returns an I
address. We use the OpsAdminTest database to do development work on our IV
system. So, as the client machine is within the IT department, it ha
access to the database currently through Access using a System DSN
>> The error message I get is: Error opening connectio
>> from the "Catch as Exception section at the start (immediately after th
Initialise Component() call
>> Is there any other way to test the actual error return code so that we ca
see it
>> thanks
>> ----- Gerry O'Brien [MVP] wrote: ----
>> No, you need to have a DSN created on the machine that will be usin
th
> program that points to the correct datasource
>> One of the problems with DSNs is distribution of apps that use them
Th
> configuration can be hard to get right
>> Let's simplify it and stick with your original connection string
>> One of the first things I would check next is to verify that th
compute
> with the app installed, that is not the dev machine, can actuall
resolv
> the computer name of SPEEDY. If you cannot find the computer on th
> network, then the connection string will fail for sure
>> If you are using TCP/IP as the protocol, on the client machine, typ
in PIN
> SPEEDY and see if you return an IP address. if so, then you ar
resolvin
> the name correctly and there is likely an authentication issue
>> What is the exact error message you are receiving on the client
>> --
> Gerry O'Brie
> Visual Developer .NET MV
> Visual Basi
>>> "debbie" <anonymous@discussions.microsoft.com> wrote in messag
> news:E7DA03B4-D9E7-468A-AD44-9785D47A5132@microsoft.com..
>> Tried using the following connection strings and results a
indicated
>>> 1st entry: This is my original connection string
>> myConnection = New SqlConnection("data source=SPEEDY;initia
> catalog=OpsAdminTest;integrated security=True"
>>> Connects correctl
>>> 2nd attempt: Modified with your suggestions
>>> myConnection = New SqlConnection("data source=OpsAdminTest;initia
> catalog=OpsAdminTest"
>>> Fails to connect to database
>>> So, it appears that the only way to connect to the server is b
using th
> 1st connection string. Any other ideas/suggestions
>>>

Re: Still unable to connect to SQL database on non-development machine by Gerry

Gerry
Tue Apr 27 10:34:06 CDT 2004

You're most welcome Debbie, hopefully it will solve your problem.

--
Gerry O'Brien
Visual Developer .NET MVP
Visual Basic


"debbie" <anonymous@discussions.microsoft.com> wrote in message
news:4AD95769-E413-49D5-BEC9-FAACA5F845AC@microsoft.com...
>
> Thanks, Gerry
>
> The MessageBox.Show(ex.Message) response was
>
> "The .Net Data SQL Provider (System.Data.SqlClient) requires
Microsfot Data Access Components(MDAC) version 2.6 or later."
>
> I will try to download and install this component on the client machine.
If this fails to correct the problem, I will let you know.
>
> I appreciate all the help you have given me.
>
> debbie
>
> ----- Gerry O'Brien [MVP] wrote: -----
>
> Well, the exception class has numerous properties that will return
> information to you. You can use MessageBox.Show or Debug.Writeline,
your
> choice, and gain access to the properties in this manner.
>
> Try
> DB connection code here
> Catch ex as Exception
> MessageBox.Show(ex.Message) or you can use ErrorCode,
InnerException or
> Source.
>
> Now, Exception is just a plain Exception object but each one of the
data
> providers has its own exception properties.
>
> --
> Gerry O'Brien
> Visual Developer .NET MVP
> Visual Basic
>
>
> "debbie" <anonymous@discussions.microsoft.com> wrote in message
> news:4318C5E6-D3BF-4B0D-80AB-82DCD3BBE206@microsoft.com...
> > The client machine can see the server. Pinging Speedy returns an
IP
> address. We use the OpsAdminTest database to do development work on
our IVR
> system. So, as the client machine is within the IT department, it
has
> access to the database currently through Access using a System DSN.
> >> The error message I get is: Error opening connection
> >> from the "Catch as Exception section at the start (immediately
after the
> Initialise Component() call.
> >> Is there any other way to test the actual error return code so
that we can
> see it?
> >> thanks.
> >> ----- Gerry O'Brien [MVP] wrote: -----
> >> No, you need to have a DSN created on the machine that will
be using
> the
> > program that points to the correct datasource.
> >> One of the problems with DSNs is distribution of apps that
use them.
> The
> > configuration can be hard to get right.
> >> Let's simplify it and stick with your original connection
string.
> >> One of the first things I would check next is to verify that
the
> computer
> > with the app installed, that is not the dev machine, can
actually
> resolve
> > the computer name of SPEEDY. If you cannot find the computer
on the
> > network, then the connection string will fail for sure.
> >> If you are using TCP/IP as the protocol, on the client
machine, type
> in PING
> > SPEEDY and see if you return an IP address. if so, then you
are
> resolving
> > the name correctly and there is likely an authentication
issue.
> >> What is the exact error message you are receiving on the
client?
> >> --
> > Gerry O'Brien
> > Visual Developer .NET MVP
> > Visual Basic
> >>> "debbie" <anonymous@discussions.microsoft.com> wrote in
message
> > news:E7DA03B4-D9E7-468A-AD44-9785D47A5132@microsoft.com...
> >> Tried using the following connection strings and results as
> indicated:
> >>> 1st entry: This is my original connection string.
> >> myConnection = New SqlConnection("data source=SPEEDY;initial
> > catalog=OpsAdminTest;integrated security=True")
> >>> Connects correctly
> >>> 2nd attempt: Modified with your suggestions.
> >>> myConnection = New SqlConnection("data
source=OpsAdminTest;initial
> > catalog=OpsAdminTest")
> >>> Fails to connect to database.
> >>> So, it appears that the only way to connect to the server is by
> using the
> > 1st connection string. Any other ideas/suggestions?
> >>>