Re: One Web Service updates SQL, another can't?

From: Steve Ricketts (steve_at_velocedge.com)
Date: 10/26/04


Date: Tue, 26 Oct 2004 14:15:01 -0400

I'm not sure how to trap the login and out events... is that "Connect" and
"Disconnect" in the trace window? I couldn't find them in the Events
section of the Trace Properties dialog. The connection string is:

strCnxn = "Provider=SQLOLEDB; Network Library=DBMSSOCN; Data
Source=xxx.xxx.xxx.xxx; Initial Catalog=CADE_LMW; User ID=sa;
Password=password"

I've tried it with and without the "Network Library" parameter and obviously
there is a real IP address in the Data Source. Watching both the debugger
and the trace, all goes well until the update statement I mentioned earlier.
There is basically nothing in the code from the last "select" call to this
"update". It just sets up the SQL string. When I let the cnxn.execute(sql)
statement run with the "update", I trapped the error and err.description
says:

"an exception of type: (System.Runtime.InteropServices.COMException)
occurred"

And then I start getting the database closed errors on subsequent calls. I
open the database again after the error and all is fine until the next
"update" statement.

sr

"Tom Moreau" <tom@dont.spam.me.cips.ca> wrote in message
news:OslYpR4uEHA.1984@TK2MSFTNGP14.phx.gbl...
> The error suggests that somehow the connection to SQL Server is being
> closed. Audit the Login and Logout events with the profiler and see if
> that's the case. I'm wondering also if there is a connection pooling
issue
> here. Could we have a look at your connection string?
>
> --
> Tom
>
> ---------------------------------------------------------------
> Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> SQL Server MVP
> Columnist, SQL Server Professional
> Toronto, ON Canada
> www.pinnaclepublishing.com
>
>
> "Steve Ricketts" <steve@velocedge.com> wrote in message
> news:uKcyPM4uEHA.1860@TK2MSFTNGP15.phx.gbl...
> I set the trace for the problem database and am receiving exactly what I
> sent. (I'm using sa just to eliminate as much of the permissions problems
> as possible). I'm stepping through the Visual Studio .Net debugger and
it's
> showing me the returned data record when its a "select" but as soon as an
> "update" is issued, I get "Operation is not allowed when the object is
> closed". The SQL Trace shows:
>
> update cmi set revised = '10/26/2004 12:32:30 PM' where person_int = 23720
> and course_int = 645 and lesson_int = 2
>
> Which is what I sent from the web service... and why would this work if
it's
> the first Web Service started and the other Service fails. It doesn't
seem
> to matter which database I use, the one I start first works and the second
> one doesn't.
>
> Steve
>
> "Tom Moreau" <tom@dont.spam.me.cips.ca> wrote in message
> news:eMxsH%233uEHA.1260@TK2MSFTNGP12.phx.gbl...
> > If it's connecting as sa - which, BTW, is a bad thing - then the
security
> is
> > essentially bypassed. The next thing I'd do is run a profiler trace and
> try
> > and see what's coming at your server. Hopefully, you can run the web
> > service in debug mode to step through it.
> >
> > --
> > Tom
> >
> > ---------------------------------------------------------------
> > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> > SQL Server MVP
> > Columnist, SQL Server Professional
> > Toronto, ON Canada
> > www.pinnaclepublishing.com
> >
> >
> > "Steve Ricketts" <steve@velocedge.com> wrote in message
> > news:uw%23Fp63uEHA.2172@TK2MSFTNGP14.phx.gbl...
> > I'm sending raw SQL and should have told you that I was opening the
> database
> > as "sa". db_denydatawriter for sa is not checked. Does that help?
> >
> > sr
> >
> >
> >
> > "Tom Moreau" <tom@dont.spam.me.cips.ca> wrote in message
> > news:uichWz3uEHA.2520@TK2MSFTNGP15.phx.gbl...
> > > Assuming that you're using raw T-SQL - not stored procs - I'd look at
> who
> > is
> > > a member of the db_denydatawriter role in the problem database.
Another
> > > thing to look at is the permissions for that user in EM. That may
tell
> > you
> > > if there are any explicit DENY's.
> > >
> > > --
> > > Tom
> > >
> > > ---------------------------------------------------------------
> > > Thomas A. Moreau, BSc, PhD, MCSE, MCDBA
> > > SQL Server MVP
> > > Columnist, SQL Server Professional
> > > Toronto, ON Canada
> > > www.pinnaclepublishing.com
> > >
> > >
> > > "Steve Ricketts" <steve@velocedge.com> wrote in message
> > > news:eZ5PcW3uEHA.3828@TK2MSFTNGP12.phx.gbl...
> > > I have a production and development system both running on one PC
under
> > W2K
> > > with SQL7sp4. One Web Service can access and update the SQL Server 7
> > > database fine. Another instance of the same Web Service code,
accessing
> a
> > > different, but identical database, can read but not update records.
It
> > > seems like whichever Web Service I start first is allowed to read and
> > write,
> > > but the other has only read permissions.
> > >
> > > Is there a exclusive, read-only, permissions setting that I've missed
> > > somewhere? The problem is simply the second Web Service can't write
to
> > SQL,
> > > but why is the big question. Any help would be greatly appreciated,
> I'm
> > > into days on this one!
> > >
> > > Thanks,
> > >
> > > Steve Ricketts
> > >
> > >
> >
> >
>
>



Relevant Pages

  • asp.net 2.0 login control
    ... A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.] ... These problems left me stranded for days, then today, on another machine, I hit a different set of problems I kept getting the following "Failed to generate user instance of SQL Server due to a failure in starting the process for the user instance. ... (Basically this is a new option in the connection string that allows you to point out where the ..mdf file resides eliminating the need to create database in some SQL instance.) ... Beware that the windows account of the user that first creates the connection in this databaseless manner, becomes exclusive user for this file and no other windows account will be able to create a connection to this file. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Newbie question on SQL connection
    ... database on my developer machine. ... > to develop databases away from the live SQL server - that way in the ... > domain SQL Server. ... Does your connection string contain a typo? ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: .NET and SQL Server on Separate Machines
    ... add this domain account as a valid login to your sql server. ... Everything was running correctly when the database ... > The connection string in our web.config file originally looked like this: ...
    (microsoft.public.sqlserver.connect)
  • Re: .NET and SQL Server on Separate Machines
    ... add this domain account as a valid login to your sql server. ... Everything was running correctly when the database ... > The connection string in our web.config file originally looked like this: ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: FP2003 fails to validate data connection
    ... The connection string is not correct or DSN are not correct. ... The machine is running XP Pro with IIS 5.1 and SQL Server 2000 both running. ... > The FP2003 Database Results Wizard and Database Interface Wizard have no problem locating the active DSNs on the machine, ... Other apps I have written have no problem using these DSNs. ...
    (microsoft.public.frontpage.programming)