Showing posts with label runs. Show all posts
Showing posts with label runs. Show all posts

Thursday, March 29, 2012

Dreaded "SQL Server does not exist or access denied. " Error

I have built a web application that runs on my local web server against my local SQL server and my development server, but now I'm trying to get it to work on the live server and I'm not getting a connection. Whenever I try to open the connection, I get a.

SQL Server does not exist or access denied.

error.

Here is my connection string...

Public connString as string

Dim SQLServerAsString = "xxx.xx.xx.xxx"

connString = "server=" & SQLServer & ";" _

& "database=DBName;Trusted_Connection=No;user id=xxxID;password=xxxPassword;"

myConnection2 =New SqlClient.SqlConnection(connString)

------------------

I'm starting my connection to run a datareader this way...

Dim strSQLAsString

strSQL = "SELECT ClientID, ClientName " & _

"FROM Client; "

' Create a connection to the table in the SQL database located on

' the remote computer.

Dim myCommand2AsNew SqlClient.SqlCommand(strSQL, myConnection2)

myCommand2.CommandTimeout = 1200

myConnection2.Open() 'HERE IS WHERE THE ERROR OCCURS

Dim myReaderAs SqlClient.SqlDataReader = myCommand2.ExecuteReader(CommandBehavior.CloseConnection)

While myReader.Read()

-------------------

I can communicate with the server with no problem from my local computer. I can ping the server, and I also tested it by creating a system DSN using the login and password in my application, and it finds the database with no problem. I've tried to connect using the SQL Server's server name and the IP address and both return the same result. I've also saw something in another post to set the trusted connection parameter to "yes" and that didn't work either.

I'm developing on a Windows XP Professional and I'm trying to connect to a Windows 2003 Server with SQL Server 2000 installed on the machine.

I did add the database by restoring a backup from my local server onto the live server. I don't think that should matter, but maybe it does. If anyone has any ideas, I would greatly appreciate it.

Try adding this to the end of your connection string and see if it makes a difference:
;Network Library =dbmssocn
This will force a TCP/IP connection instead of a named pipes connection.

(fromBUG: Named pipes do not work when worker process runs under ASPNET account)|||Thanks for the suggestion. Unfortunately that didn't work. Could there be some server firewall setting that is preventing the web user account from accessing the server?|||I would also try adding a port number to the end of the IP address:

Dim SQLServerAsString = "xxx.xx.xx.xxx,1433"

And I would remove Trusted_Connection=No completely. Seehttp://www.connectionstrings.comfor connection string examples. If none of that works, perhapsthe user ID and password are incorrect? Sorry, just grasping atstraws. My last recommendation is to review this KB article:Potential causes of the "SQL Server does not exists or access denied" error message. As you'll see, there are a lot of things to check.|||Thanks for your help. It looks like the problem stemmed from a security hole in Windows 2003 Server, which was shutting down the TCP ports. We applied SP4 and it seems to be working for now. Hopefully that's all it was.

DR Test Scenario

Hello All

We have Asynchronous DB Mirroring established for our Production database

which runs on SQL Server 2005.

For the DR Test we plan to do the following during the period of low activity :

1. Pause the mirroring on the Principal Server.

2. Break the mirror on the Mirror Server

3. Take on offline backup on the Mirror.

4. Bring the Mirror Database up.

5. Run the DR Tests on the Mirrored Database

6. Restore the Offline Backup taken in step 3.

7. Reestablish the mirror from the Principal to Mirror.

8. Resume Mirroring on the Principal Server.

9. Verify Mirroring is happening on the Mirror Server

Can u please let me know if this plan is feasible and if there should be any modifications to the plan that are required. Any other suggestions/input is appreciated.

TIA

Best,

Jay

Hi Jay,

You do need to pause and break the mirror on two different places to start with. Also I don't think your plan is feasible.

If you want to test the Mirror. DO the following:

1. Perform a backup of Principal database.

2. Break the mirror. (if you don't intend to keep changes from DR test)

3. Bring the mirror online.

4. Do your tests on the mirror.

5. Once finished testing, restore the database backup , taken in Step 1, to the as mirror db on mirror server.

6. Apply any logs if any necessary.

7. reconfigure mirroring.

Jag

Sunday, March 11, 2012

Double inserts during snapshot posting of transactional replication

Hi,
So, I have setup transactional replication, uses the initial snapshot. When
the snapshot is being posted, it runs the same command, and causing it to
fail on the primary key constraint.
Has anyone seen this before?
Gary,
please can you post up the error message.
Also, are you doing a nosync subscription or is it a full initialization?
Regards,
Paul Ibison

Wednesday, March 7, 2012

Don't send subscription if no data on report

I am fairly new to Reporting Services. That said I have created a
report that runs daily and via a subscription sends the report as
email. This works fine day in and day out, however some days there is
no data for the report. On the days when the report contains no data I
don't want a blank report sent to the subscribers, I prefer that they
get nothing. Is this out of the box functionality and I'm just not
finding it or is it coding I need to do? Much thanks to anyone willing
to point me in the right direction.
Amy Slankard
aslankard@.alumni.cofc.eduI don't think that functionality is built in but my way of handling it
is to include something in the subscription query that returns an
empty query if there is no data in the report. Nothing bad happens if
the subscription query returns no subscribers, just nothing gets sent.
It means including some form of the actual report query in the
subscription query so depending on how complex things are that may or
may not be a very practical or efficient way to go. My situation needs
some fairly heavy preprocessing that runs using the SQL Server Agent
in the early morning which among other things, sets a bit flag in a
table to say whether or not there is any data to report. My report
that runs some time later then includes that flag in its subscription
query.
Cheers
Ross
On 30 Mar 2005 06:50:27 -0800, "aslankard@.alumni.cofc.edu"
<amy.slankard@.gmail.com> wrote:
>I am fairly new to Reporting Services. That said I have created a
>report that runs daily and via a subscription sends the report as
>email. This works fine day in and day out, however some days there is
>no data for the report. On the days when the report contains no data I
>don't want a blank report sent to the subscribers, I prefer that they
>get nothing. Is this out of the box functionality and I'm just not
>finding it or is it coding I need to do? Much thanks to anyone willing
>to point me in the right direction.
>Amy Slankard
>aslankard@.alumni.cofc.edu