473,738 Members | 10,643 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VS 2003 + opening a connection to SQL SERVER 2000 database

Hey all

I am building a new computer.
I have Windows XP Pro with SP2 and all the updates.

I installed VS 2003.
Then copied a project from my old computer to the new one.

When I try and run the project .. it errors out saying it "sql server does
not exist or access denied"

The connection string is obviously the exact same as when it ran on the old
computer ... as all the files came from the old computer ... where the
project works just fine.
The MSSQL server is running on a seperate computer all together.

I can open query analyzer and access the database, no problem. On the new
machine.
I can even use Tools .. Connect to Database ... in VS 2003 IDE and that
works ...

Just in my vb.net code is it failing .. and again .. it work just fine on
the old development machine.
Any ideas ??

Thanks
Jon

Nov 20 '05 #1
18 1995
what is your string connection?

"Jon Delano" <jd*****@hotmai l.com> escribió en el mensaje
news:aq******** ************@co mcast.com...
Hey all

I am building a new computer.
I have Windows XP Pro with SP2 and all the updates.

I installed VS 2003.
Then copied a project from my old computer to the new one.

When I try and run the project .. it errors out saying it "sql server does
not exist or access denied"

The connection string is obviously the exact same as when it ran on the
old computer ... as all the files came from the old computer ... where the
project works just fine.
The MSSQL server is running on a seperate computer all together.

I can open query analyzer and access the database, no problem. On the new
machine.
I can even use Tools .. Connect to Database ... in VS 2003 IDE and that
works ...

Just in my vb.net code is it failing .. and again .. it work just fine on
the old development machine.
Any ideas ??

Thanks
Jon

Nov 20 '05 #2
Is this a web app? What is does your connection string look like? Are you
connection to SQL using integrated security? Is it using trying to use your
local ASPNET account?

Greg
"Jon Delano" <jd*****@hotmai l.com> wrote in message
news:aq******** ************@co mcast.com...
Hey all

I am building a new computer.
I have Windows XP Pro with SP2 and all the updates.

I installed VS 2003.
Then copied a project from my old computer to the new one.

When I try and run the project .. it errors out saying it "sql server does
not exist or access denied"

The connection string is obviously the exact same as when it ran on the
old computer ... as all the files came from the old computer ... where the
project works just fine.
The MSSQL server is running on a seperate computer all together.

I can open query analyzer and access the database, no problem. On the new
machine.
I can even use Tools .. Connect to Database ... in VS 2003 IDE and that
works ...

Just in my vb.net code is it failing .. and again .. it work just fine on
the old development machine.
Any ideas ??

Thanks
Jon

Nov 20 '05 #3
Sorry for the bad grammar. :^) Let's try that again.

Is this a web app? What does your connection string look like? Are you
connecting to SQL using integrated security? Is it trying to use your local
ASPNET account?

"Greg Burns" <bl*******@news groups.nospam> wrote in message
news:OK******** ********@TK2MSF TNGP12.phx.gbl. ..
Is this a web app? What is does your connection string look like? Are you
connection to SQL using integrated security? Is it using trying to use
your local ASPNET account?

Nov 20 '05 #4
Hello Thanks all for the quick replies ...

Here is the connection string as it sits in my web config file :
<add key="Repository ConnectionStrin g"
value="server=s erver;uid=sa;pw d=password;data base=ShepherdRe pository;Connec t
Timeout=120" />

Here is the code that is running ...

If Not IsPostBack Then

Dim cmdCheckReposit oryAvailability As New SqlCommand
Dim rdrCheckReposit oryAvailability As SqlDataReader
Dim Conn As SqlConnection

Try
' check the flag for repository availability
Dim SQL As String
Conn = New
SqlConnection(C onfigurationSet tings.AppSettin gs("RepositoryC onnectionString "))
Conn.Open()

SQL = "Select RepositoryAvail able from tblProperty"
cmdCheckReposit oryAvailability = New SqlCommand(SQL, Conn)
rdrCheckReposit oryAvailability =
cmdCheckReposit oryAvailability .ExecuteReader

If rdrCheckReposit oryAvailability .Read Then
If rdrCheckReposit oryAvailability ("RepositoryAva ilable")
= 0 Then
' its not available
txtUserName.Ena bled = False
txtPassword.Ena bled = False
btnLogin.Enable d = False

Label1.ForeColo r = Color.Blue
Label1.Font.Bol d = True
Label1.Font.Siz e = FontUnit.Medium
Label1.Text = "<center>Th e repository is unavailable
at this time.</center>"
End If
End If
Catch
txtUserName.Ena bled = False
txtPassword.Ena bled = False
btnLogin.Enable d = False

Label1.ForeColo r = Color.DarkBlue
Label1.Font.Bol d = True
Label1.Font.Siz e = FontUnit.Medium
Label1.Text = "<center>Th e repository is unavailable at this
time.</center>"
Finally

cmdCheckReposit oryAvailability .Dispose()
cmdCheckReposit oryAvailability = Nothing

If Not rdrCheckReposit oryAvailability Is Nothing Then
rdrCheckReposit oryAvailability .Close()
End If

rdrCheckReposit oryAvailability = Nothing

Conn.Close()
Conn = Nothing

End Try

This is a web application, I don't remember having to do anything special on
the old development machine to be able to connect to SQL Server.
As you can see I am using SQL Server Authentication (using sa is only in my
test network <grin>)

Thanks for any assistance, please let me know if there is anything else you
need.

Jon
jd*****@hotmail .com
"Greg Burns" <bl*******@news groups.nospam> wrote in message
news:Oi******** ********@TK2MSF TNGP10.phx.gbl. ..
Sorry for the bad grammar. :^) Let's try that again.

Is this a web app? What does your connection string look like? Are you
connecting to SQL using integrated security? Is it trying to use your
local ASPNET account?

"Greg Burns" <bl*******@news groups.nospam> wrote in message
news:OK******** ********@TK2MSF TNGP12.phx.gbl. ..
Is this a web app? What is does your connection string look like? Are
you connection to SQL using integrated security? Is it using trying to
use your local ASPNET account?


Nov 20 '05 #5
I was not expecting to see sa being used. That definately eliminates a lot
of my theories. :^)

Only thing I have left to offer is perhaps XP SP2's firewall???

Greg

"Jon Delano" <jd*****@hotmai l.com> wrote in message
news:6v******** *************** *******@comcast .com...
Hello Thanks all for the quick replies ...

Here is the connection string as it sits in my web config file :
<add key="Repository ConnectionStrin g"
value="server=s erver;uid=sa;pw d=password;data base=ShepherdRe pository;Connec t
Timeout=120" />

Here is the code that is running ...

If Not IsPostBack Then

Dim cmdCheckReposit oryAvailability As New SqlCommand
Dim rdrCheckReposit oryAvailability As SqlDataReader
Dim Conn As SqlConnection

Try
' check the flag for repository availability
Dim SQL As String
Conn = New
SqlConnection(C onfigurationSet tings.AppSettin gs("RepositoryC onnectionString "))
Conn.Open()

SQL = "Select RepositoryAvail able from tblProperty"
cmdCheckReposit oryAvailability = New SqlCommand(SQL, Conn)
rdrCheckReposit oryAvailability =
cmdCheckReposit oryAvailability .ExecuteReader

If rdrCheckReposit oryAvailability .Read Then
If
rdrCheckReposit oryAvailability ("RepositoryAva ilable") = 0 Then
' its not available
txtUserName.Ena bled = False
txtPassword.Ena bled = False
btnLogin.Enable d = False

Label1.ForeColo r = Color.Blue
Label1.Font.Bol d = True
Label1.Font.Siz e = FontUnit.Medium
Label1.Text = "<center>Th e repository is
unavailable at this time.</center>"
End If
End If
Catch
txtUserName.Ena bled = False
txtPassword.Ena bled = False
btnLogin.Enable d = False

Label1.ForeColo r = Color.DarkBlue
Label1.Font.Bol d = True
Label1.Font.Siz e = FontUnit.Medium
Label1.Text = "<center>Th e repository is unavailable at
this time.</center>"
Finally

cmdCheckReposit oryAvailability .Dispose()
cmdCheckReposit oryAvailability = Nothing

If Not rdrCheckReposit oryAvailability Is Nothing Then
rdrCheckReposit oryAvailability .Close()
End If

rdrCheckReposit oryAvailability = Nothing

Conn.Close()
Conn = Nothing

End Try

This is a web application, I don't remember having to do anything special
on the old development machine to be able to connect to SQL Server.
As you can see I am using SQL Server Authentication (using sa is only in
my test network <grin>)

Thanks for any assistance, please let me know if there is anything else
you need.

Jon
jd*****@hotmail .com
"Greg Burns" <bl*******@news groups.nospam> wrote in message
news:Oi******** ********@TK2MSF TNGP10.phx.gbl. ..
Sorry for the bad grammar. :^) Let's try that again.

Is this a web app? What does your connection string look like? Are you
connecting to SQL using integrated security? Is it trying to use your
local ASPNET account?

"Greg Burns" <bl*******@news groups.nospam> wrote in message
news:OK******** ********@TK2MSF TNGP12.phx.gbl. ..
Is this a web app? What is does your connection string look like? Are
you connection to SQL using integrated security? Is it using trying to
use your local ASPNET account?



Nov 20 '05 #6
Oh yeah ... the server that sql server 2000 is running on is Windows 2000

"Greg Burns" <bl*******@news groups.nospam> wrote in message
news:Oi******** ********@TK2MSF TNGP10.phx.gbl. ..
Sorry for the bad grammar. :^) Let's try that again.

Is this a web app? What does your connection string look like? Are you
connecting to SQL using integrated security? Is it trying to use your
local ASPNET account?

"Greg Burns" <bl*******@news groups.nospam> wrote in message
news:OK******** ********@TK2MSF TNGP12.phx.gbl. ..
Is this a web app? What is does your connection string look like? Are
you connection to SQL using integrated security? Is it using trying to
use your local ASPNET account?


Nov 20 '05 #7
I checked that ... I have it off .. as I am using NAT and am behind a
router.
The server I am connecting to is behind the router as well.

This is so strange ...
"Greg Burns" <bl*******@news groups.nospam> wrote in message
news:%2******** *********@TK2MS FTNGP09.phx.gbl ...
I was not expecting to see sa being used. That definately eliminates a lot
of my theories. :^)

Only thing I have left to offer is perhaps XP SP2's firewall???

Greg

"Jon Delano" <jd*****@hotmai l.com> wrote in message
news:6v******** *************** *******@comcast .com...
Hello Thanks all for the quick replies ...

Here is the connection string as it sits in my web config file :
<add key="Repository ConnectionStrin g"
value="server=s erver;uid=sa;pw d=password;data base=ShepherdRe pository;Connec t
Timeout=120" />

Here is the code that is running ...

If Not IsPostBack Then

Dim cmdCheckReposit oryAvailability As New SqlCommand
Dim rdrCheckReposit oryAvailability As SqlDataReader
Dim Conn As SqlConnection

Try
' check the flag for repository availability
Dim SQL As String
Conn = New
SqlConnection(C onfigurationSet tings.AppSettin gs("RepositoryC onnectionString "))
Conn.Open()

SQL = "Select RepositoryAvail able from tblProperty"
cmdCheckReposit oryAvailability = New SqlCommand(SQL, Conn)
rdrCheckReposit oryAvailability =
cmdCheckReposit oryAvailability .ExecuteReader

If rdrCheckReposit oryAvailability .Read Then
If
rdrCheckReposit oryAvailability ("RepositoryAva ilable") = 0 Then
' its not available
txtUserName.Ena bled = False
txtPassword.Ena bled = False
btnLogin.Enable d = False

Label1.ForeColo r = Color.Blue
Label1.Font.Bol d = True
Label1.Font.Siz e = FontUnit.Medium
Label1.Text = "<center>Th e repository is
unavailable at this time.</center>"
End If
End If
Catch
txtUserName.Ena bled = False
txtPassword.Ena bled = False
btnLogin.Enable d = False

Label1.ForeColo r = Color.DarkBlue
Label1.Font.Bol d = True
Label1.Font.Siz e = FontUnit.Medium
Label1.Text = "<center>Th e repository is unavailable at
this time.</center>"
Finally

cmdCheckReposit oryAvailability .Dispose()
cmdCheckReposit oryAvailability = Nothing

If Not rdrCheckReposit oryAvailability Is Nothing Then
rdrCheckReposit oryAvailability .Close()
End If

rdrCheckReposit oryAvailability = Nothing

Conn.Close()
Conn = Nothing

End Try

This is a web application, I don't remember having to do anything special
on the old development machine to be able to connect to SQL Server.
As you can see I am using SQL Server Authentication (using sa is only in
my test network <grin>)

Thanks for any assistance, please let me know if there is anything else
you need.

Jon
jd*****@hotmail .com
"Greg Burns" <bl*******@news groups.nospam> wrote in message
news:Oi******** ********@TK2MSF TNGP10.phx.gbl. ..
Sorry for the bad grammar. :^) Let's try that again.

Is this a web app? What does your connection string look like? Are you
connecting to SQL using integrated security? Is it trying to use your
local ASPNET account?

"Greg Burns" <bl*******@news groups.nospam> wrote in message
news:OK******** ********@TK2MSF TNGP12.phx.gbl. ..
Is this a web app? What is does your connection string look like? Are
you connection to SQL using integrated security? Is it using trying to
use your local ASPNET account?



Nov 20 '05 #8
You say you are getting "sql server does not exist or access denied", but I
don't see where you are recording the error in your catch statement. How
can you tell what the error is from the code you posted?

Try
....
Catch ex as exception
trace.warn(ex.t ostring)
...
Finally
....
End Try

Change your catch to something like that. You could, of course, put a
breakpoint on the catch statement itself and take a look ex's value.

Greg
"Jon Delano" <jd*****@hotmai l.com> wrote in message
news:ZO******** ************@co mcast.com...
Oh yeah ... the server that sql server 2000 is running on is Windows 2000

"Greg Burns" <bl*******@news groups.nospam> wrote in message
news:Oi******** ********@TK2MSF TNGP10.phx.gbl. ..
Sorry for the bad grammar. :^) Let's try that again.

Is this a web app? What does your connection string look like? Are you
connecting to SQL using integrated security? Is it trying to use your
local ASPNET account?

"Greg Burns" <bl*******@news groups.nospam> wrote in message
news:OK******** ********@TK2MSF TNGP12.phx.gbl. ..
Is this a web app? What is does your connection string look like? Are
you connection to SQL using integrated security? Is it using trying to
use your local ASPNET account?



Nov 20 '05 #9
In VS 2003 ... I had changed the catch to catch ex as exception ...
Then put a break point in that section ... when it stopped there ... I did a
quick watch on ex ...
"Greg Burns" <bl*******@news groups.nospam> wrote in message
news:uM******** ********@TK2MSF TNGP12.phx.gbl. ..
You say you are getting "sql server does not exist or access denied", but
I don't see where you are recording the error in your catch statement.
How can you tell what the error is from the code you posted?

Try
...
Catch ex as exception
trace.warn(ex.t ostring)
...
Finally
...
End Try

Change your catch to something like that. You could, of course, put a
breakpoint on the catch statement itself and take a look ex's value.

Greg
"Jon Delano" <jd*****@hotmai l.com> wrote in message
news:ZO******** ************@co mcast.com...
Oh yeah ... the server that sql server 2000 is running on is Windows 2000

"Greg Burns" <bl*******@news groups.nospam> wrote in message
news:Oi******** ********@TK2MSF TNGP10.phx.gbl. ..
Sorry for the bad grammar. :^) Let's try that again.

Is this a web app? What does your connection string look like? Are you
connecting to SQL using integrated security? Is it trying to use your
local ASPNET account?

"Greg Burns" <bl*******@news groups.nospam> wrote in message
news:OK******** ********@TK2MSF TNGP12.phx.gbl. ..
Is this a web app? What is does your connection string look like? Are
you connection to SQL using integrated security? Is it using trying to
use your local ASPNET account?



Nov 20 '05 #10

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

Similar topics

11
3763
by: Wolfgang Kaml | last post by:
Hello All, I have been working on this for almost a week now and I haven't anything up my sleeves anymore that I could test in addition or change.... Since I am not sure, if this is a Windows 2003 Server or ADO or ODBC issue, I am posting this on all of the three newsgroups. That's the setup: Windows 2003 Server with IIS and ASP.NET actiavted Access 2002 mdb file (and yes, proper rights are set on TMP paths and path,
1
2390
by: Marino | last post by:
Hi all, I have a Windows 2003 server, which is also a terminal server for application, with sql 2000 installed. My company has developed an application that uses SQL 2000 as its database. The application is a client/server one. In each client computer there's a link to the application on the server. There is no problem with Windows 98, Windows 2000 pro, Windows xp pro clients, but the windows 95 ones cannot log in to the database. The...
2
3214
by: Vaap | last post by:
I did lot of googling to see if I can solve the SQL server not found problem while trying to run ASP.Net community starter kit from an XP machine to Windows 2003 server hosting SQL server 2000 database. Tried all possible combinations but it still fails. I have Windows 2003 server having SQL Server 2000 installed with SP2. The installation went Ok on a XP professional machine and I was able to create database and user logins etc on...
5
3812
by: Microsoft | last post by:
Hi, I have Visual Basic .net 2003 (Standard Edition) & SQL Server 2000 Developer Edition. When trying to create a connection in the server explorer from the .net IDE I get a number of problems; a.. Under the "Connection" tab, under "1. Select or enter a server name:" when I either select the drop down box or click the refresh button I get an error dialog saying "Error enumerating data servers. Enumerator reports Unspecified error'". The...
3
2013
by: Vinod R.Shenoy | last post by:
Hi All, Came across a post wherin you had helped somebody with a similar problem and was wondering if you could help us out with it. Our problem is , We have a development SQL Server 2000 (running on Win2K SP4) machine that we want to run on a Windows 2003 server machine and access it via our internal LAN. We have opened the firewall to allow our applications
4
3153
by: Cindy H | last post by:
Hi I am currently using Visual Studio.Net 2003 running on Windows Server 2000 operating system. I have used Visual Studio.net 2003 connecting to Access 2002 databases in the pass with great success. Now, I have a need to go to Access 2007 which produces database.accdb file instead of database.mdb. I've used ole db Jet 4.0 to connect to Access 2002 in Visual Studio.Net 2003, now I guess you need to use Microsoft Ace 12.0 to make a...
2
4594
by: Bruce | last post by:
Hello all, I have an annoyance that is common to all of the Access 2003 applications I manage. All of the applications are split front end/ back end with a front end copy on each client workstation and back ends on a common server. They are all secured with workgroup files also residing on the server. Each front end has a mix of linked tables and local tables. The annoyance I have noticed is that it sometimes takes 10 to 15 seconds...
0
8969
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8788
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9476
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9263
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8210
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6751
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4570
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4825
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2745
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.