Showing posts with label environment. Show all posts
Showing posts with label environment. Show all posts

Sunday, March 25, 2012

Connectivity?

Dev Tool: VB6
Server: SQL Server 2000.
Environment: Windows 2000/Windows XP/Windows 2000 Server
I have changed a user connectivity from WINDOWS NT trusted connection to
SQL Server Authentication.
I have granted the same permissions to the new user.
The problem is as follows:
The new user cannot execute stored procedures which contains INSERT staments
.
Having the same connection and user id. When I execute the stored procedure
in the Query Analyzer console I have no problem, but when I execute it in a
Visual Basic 6.0 Application, using ADO, I get the following message:
"Operation is not Allowed when the Object is closed."
Note: I created the table, so I'm the owner, I should have no problems(??)
Any ideas?
RickRick,
Can you send your vb code where you open the ADO connection, execute the
stored proc, and then close the connection?
Thanks,
Yosh
"Rick" <Rick@.discussions.microsoft.com> wrote in message
news:131F18F8-146E-410F-8E84-2610E2871512@.microsoft.com...
> Dev Tool: VB6
> Server: SQL Server 2000.
> Environment: Windows 2000/Windows XP/Windows 2000 Server
> I have changed a user connectivity from WINDOWS NT trusted connection to
> SQL Server Authentication.
> I have granted the same permissions to the new user.
> The problem is as follows:
> The new user cannot execute stored procedures which contains INSERT
> staments.
> Having the same connection and user id. When I execute the stored
> procedure
> in the Query Analyzer console I have no problem, but when I execute it in
> a
> Visual Basic 6.0 Application, using ADO, I get the following message:
> "Operation is not Allowed when the Object is closed."
> Note: I created the table, so I'm the owner, I should have no problems(?)
> Any ideas?
>
> --
> Rick|||I get an error with the debugger.
Rick
"Yosh" wrote:

> Rick,
> Can you send your vb code where you open the ADO connection, execute the
> stored proc, and then close the connection?
> Thanks,
> Yosh
> "Rick" <Rick@.discussions.microsoft.com> wrote in message
> news:131F18F8-146E-410F-8E84-2610E2871512@.microsoft.com...
>
>

Wednesday, March 7, 2012

Connection to database on a remote server

Here is my environment and problem:

I have VWD 2005 and SSE 2005 installed on my local machine. I also have these installed on my Windows 2003 Server. I developed my database using SSE on my local machine but pointing to directory on my server. I have been developing the web app using VWD on my server. I now want to use VWD on my local machine and point to the project on my server. I am able to open the project. In order to access the database in the "Database Explorer" I use as my "Data Source", "MS SQL Server (SQL Client) and it attaches fine and I can see my tables and data.

Now for my problem:

When I try to run the application "VIew in Browser", which login.aspx page is my first page, I get the page, but it doesn't inherit my master page which has the basic navigation and layout. Then after I try to login I get this message.

The file "W:\BBApp\App_Data\TimeTracker.mdf" is on a network path that is not supported for database files.
An attempt to attach an auto-named database for file W:\BBApp\App_Data\TimeTracker.mdf failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.

Here is a portion of my web.config file for the connection string.

<connectionStrings>

<removename="LocalSqlServer" />

<addname="LocalSqlServer"connectionString="Data Source=.\SQLExpress;Integrated Security=true;AttachDBFilename=|DataDirectory|TimeTracker.mdf;User Instance=true" />

My website I started with the source code for the TimeTracker start kit and have added more pages and changed the sitemap.

In general I guess I need to know how to handle using VWD on my local machine, but accessing the project on the server. The reason I'm doing this is because my colleague needs to be able to access the web app too to add pages to the site.

Thank you for any help.

Take a read of this articlehttp://www.aspspider.net/resources/Resource170.aspx
should see you right. Also if you are using membership remember you will need to take
care about the aspnetdb.mdf aswell.

Hope it help, if not let me know.

Friday, February 24, 2012

Connection String Problem

Hi, I seem to be having a problem with my connection string to a SQL server database. In my test environment all works well, However when I upload my site
I get the following (I have modified the connection string to reflect the production environment)


IErrorInfo.GetDescription failed with DB_E_NOLOCALE(ox800040E41)
At a guess I would say OleDb cant find the server - any Ideas?

Thanks
BigAmbiI usehttp://www.connectionstrings.comas a connection string reference. Perhaps something there willhelp you. If not, post back here with your connection string code.

Friday, February 10, 2012

Connection problem

I have a multi-user web environment and amoccassionally receiving the following error msg with our SQL Server 2005 db:

A transport-level error has occurred when sending the request to the server. (provider: TCP Provider, error: 0 - An existing connection was forcibly closed by the remote host.)

I know there are numerous posts about this, but there doesn't seem to be a definitive "fix" for the issue after looking at the posts.

I am using the "WITH (NOLOCK)" option on some of the tables within my stored procedures. I need this option for certain tables I am accessing.

My ConnectionstringTimeout property is set for 45 seconds and my CommandTimeout property is set for 150 seconds.

Could a MS DBA please look into this issueASAP and get back with a definitive resolution?

btw, I am also using Connection Pooling with a min size of 2 and max size of 200.

Can someone please reply back who knows a definitive resolution to this problem?

|||

Hi wsyeager,

Well, seems thre is no ms dba answer your question here so i would try to deliver some effort. I searched through google and found this information. It makes sense to me

guess the problem is the connection pool. Recall that when you close
a connection from your .Net app, the connection to SQL Server is not
really closed. Instead ADO .Net lingers to it, for another 60 seconds,
and if the applicaiton opens a new connection during this time, it will
reuse the connection.

When you issue ALTER DATABASE WITH ROLLBACK IMMEDIATE, SQL Server will
terminate these connections. However, this is not something that ADO .Net
can detect. So it gives you a connection which it thinks is good, but
which isn't.

There are a couple of ways to approach this. One is to configure the
connection pool, so that all connections are dropped when you drop the
database. Another is to change the connection string, each time you
drop the database, as different connection strings gives different pools.

I would suggest that the best way, though, is simply to set up an exception
handler, so that you simply trap this error, and then try to reconnect.

See original artilce at:http://www.msdner.com/forum/thread476823.html

I sincerely hope it can help

|||

Bo, thanks a lot!

I simply look for that exception number (10054) in my middle tier object and retry the cmd again and it works fine now.