Wednesday, March 21, 2012
Login failed for user
I am using MSDE2K and an application written in VB6
After installing MSDE and my program on to a new computer I am having
strange problems when saving data which I didn't get on the old computer
My connection string is...
cn.ConnectionString = "Provider=SQLOLEDB;Persist Security Info=False;User
ID=Tramcars;Password=ga711bm;Initial Catalog=Tramcars;Data Source=(local)"
(User ID Tramcars exists in MSDE and is included in the db_owner role)
This connects me OK and allows me to enter new data and save
On creating a new entry and attempting to save again I get the message
'Login failed for user Tramcars'
If I set 'Persist Security Info=True' in the connection string, all works
fine
I am completely lost
Any ideas?
Regards
Steve
hi Steve,
steve wrote:
> Hi All
> I am using MSDE2K and an application written in VB6
> After installing MSDE and my program on to a new computer I am having
> strange problems when saving data which I didn't get on the old
> computer
> My connection string is...
> cn.ConnectionString = "Provider=SQLOLEDB;Persist Security
> Info=False;User ID=Tramcars;Password=ga711bm;Initial
> Catalog=Tramcars;Data Source=(local)"
> (User ID Tramcars exists in MSDE and is included in the db_owner role)
> This connects me OK and allows me to enter new data and save
> On creating a new entry and attempting to save again I get the message
> 'Login failed for user Tramcars'
> If I set 'Persist Security Info=True' in the connection string, all
> works fine
>
MSDE installs by default disabling standard SQL Server authenticated
connections..
thus only WinNT (trusted) connections will work..
you can modify this behavior both at install time, providing the
SECURITYMODE=SQL
parameter to the setup.exe boostrap installer, or later, at "run-time",
hacking the windows registry as described in
http://support.microsoft.com/default...b;en-us;285097
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.15.0 - DbaMgr ver 0.60.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||Hi Andrea
MSDE is set to mixed mode when this happens
Strange thing is it allows me to save once, but fails with message on second
save?
Regards
Steve
"Andrea Montanari" <andrea.sqlDMO@.virgilio.it> wrote in message
news:3n8lalFcjubU1@.individual.net...
> hi Steve,
> steve wrote:
> MSDE installs by default disabling standard SQL Server authenticated
> connections..
> thus only WinNT (trusted) connections will work..
> you can modify this behavior both at install time, providing the
> SECURITYMODE=SQL
> parameter to the setup.exe boostrap installer, or later, at "run-time",
> hacking the windows registry as described in
> http://support.microsoft.com/default...b;en-us;285097
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.15.0 - DbaMgr ver 0.60.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>
|||hi Steve,
steve wrote:
> Hi Andrea
> MSDE is set to mixed mode when this happens
> Strange thing is it allows me to save once, but fails with message on
> second save?
>
you mean you can connect with the provided connection string once, but if
you try a second time you get that exception?
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.15.0 - DbaMgr ver 0.60.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||Hi Andrea
Yes thats exactly what I mean
I can connect to msde when my program starts, to populate comboboxes etc
I always close the connection when not needed (con.close)
I can then create 1 invoice and save it OK, which requires..
con.open
code to save data....
con.close
If I then try to save another invoice
con.open
etc
con.close
Error raised at con.open (login failed for user Tramcarslogin)
It is like the connectionstring forgets the login password on the second
attempt
If I use persist security info=true in the connectionstring I don't get the
error and everything is OK
Regards
Steve
"Andrea Montanari" wrote:
> hi Steve,
> steve wrote:
> you mean you can connect with the provided connection string once, but if
> you try a second time you get that exception?
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.15.0 - DbaMgr ver 0.60.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>
>
|||hi Steve,
Steve wrote:
> Hi Andrea
> Yes thats exactly what I mean
> I can connect to msde when my program starts, to populate comboboxes
> etc
> I always close the connection when not needed (con.close)
> I can then create 1 invoice and save it OK, which requires..
> con.open
> code to save data....
> con.close
> If I then try to save another invoice
> con.open
> etc
> con.close
> Error raised at con.open (login failed for user Tramcarslogin)
> It is like the connectionstring forgets the login password on the
> second attempt
> If I use persist security info=true in the connectionstring I don't
> get the error and everything is OK
ok, I think I understand... or hope so...
you do something like
Dim sCon As String
Dim oCon As ADODB.Connection
Set oCon = New ADODB.Connection
sCon = "Provider=sqloledb;Data Source=(Local);Initial Catalog=pubs;User
Id=sa;Password=xxx;persist security info=false"
oCon.Open sCon
DoSomethingWithConnection oCon ' here you consume a recordset or command or
the like
oCon.Close
oCon.Open
DoSomethingWithConnection oCon ' here you consume a recordset or command or
the like
oCon.Close
Set oCon = Nothing
that's to say you open the connection the second time without providing a
connection string and relying on the old provided one..
the specific property, "Persist Security Info" is there to specify whether
or not the data source object is allowed to persist sensitive authentication
information (such as pwd) along with other info.. as it has been set to
false, there's no way for the 2nd open method to know such a kind of info,
and the provider will refuse to pass the connection on..
if this is the case, you should not rely on such a mechanism for 2 reason..
1st you always should completely destroy the ADODB.Connection object when
not needed,
oCon.Close
Set oCon = Nothing
so that all finalizers of the object will be properly called, and the conn
will return to the connection pool...
2nd, (and also becouse of the preceding one) you always should provide a
full qualified connection string...
is a comparable/compatible one can be found in the connection pool, it will
be picked up from there, or a new one will be createad ...
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.15.0 - DbaMgr ver 0.60.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply
|||Hi Andrea
Thanks again for a great explanation
Explains everything
Regards
Steve
"Andrea Montanari" wrote:
> hi Steve,
> Steve wrote:
> ok, I think I understand... or hope so...
> you do something like
> Dim sCon As String
> Dim oCon As ADODB.Connection
> Set oCon = New ADODB.Connection
> sCon = "Provider=sqloledb;Data Source=(Local);Initial Catalog=pubs;User
> Id=sa;Password=xxx;persist security info=false"
> oCon.Open sCon
> DoSomethingWithConnection oCon ' here you consume a recordset or command or
> the like
> oCon.Close
> oCon.Open
> DoSomethingWithConnection oCon ' here you consume a recordset or command or
> the like
> oCon.Close
> Set oCon = Nothing
> that's to say you open the connection the second time without providing a
> connection string and relying on the old provided one..
> the specific property, "Persist Security Info" is there to specify whether
> or not the data source object is allowed to persist sensitive authentication
> information (such as pwd) along with other info.. as it has been set to
> false, there's no way for the 2nd open method to know such a kind of info,
> and the provider will refuse to pass the connection on..
> if this is the case, you should not rely on such a mechanism for 2 reason..
> 1st you always should completely destroy the ADODB.Connection object when
> not needed,
> oCon.Close
> Set oCon = Nothing
> so that all finalizers of the object will be properly called, and the conn
> will return to the connection pool...
> 2nd, (and also becouse of the preceding one) you always should provide a
> full qualified connection string...
> is a comparable/compatible one can be found in the connection pool, it will
> be picked up from there, or a new one will be createad ...
> --
> Andrea Montanari (Microsoft MVP - SQL Server)
> http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
> DbaMgr2k ver 0.15.0 - DbaMgr ver 0.60.0
> (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
> interface)
> -- remove DMO to reply
>
>
Friday, March 9, 2012
Login and Operation Problem
From Microsoft's website: http://msdn2.microsoft.com/en-us/library/ms143520.aspx
Report definition (.rdl) files that you create in the SQL Server 2005 version of Report Designer can only be published to a SQL Server 2005 report server.
Friday, February 24, 2012
Logging to second disk -- what happens when it crashes?
The data and the logs are all written to this array. We don't
have huge volume of activity, but it is growing. Most activity
is from our website that interacts a lot with the database.
We have read that it is a good idea to separate the data files
from the log files, having each on separate disks (or in the
case of RAID, separate arrays). So, we are considering adding
a separate SCSI hard drive, or maybe a RAID 1 system, and have
sql server log to that instead.
My question is, what happens if that secondary drive or array
completely fails. Let's say it melts. Assuming the OS doesn't
crash (Windows 2003 Server), what will SQL Server 2000 do when
the drive stops working and it is trying to write its data
logging to it? Will it continue to function and write alert
events? Will it shutdown? If it shuts down, how do we alter its
configuration to tell it to use another drive for the logs?
Also, what kind of throughput would we need to be doing to see
any kind of benefit to making this change? It is easier to
justify the expense of another disk or RAID setup if it is
actually going to matter. ;-)
Thanks all!
Thomas"Thomas" <thomas-ggl-02@.data.iatn.net> wrote in message
news:a9081691.0406021521.54c0f399@.posting.google.c om...
> Currently we have SQL Server running on a single RAID5 array.
> The data and the logs are all written to this array. We don't
> have huge volume of activity, but it is growing. Most activity
> is from our website that interacts a lot with the database.
> We have read that it is a good idea to separate the data files
> from the log files, having each on separate disks (or in the
> case of RAID, separate arrays). So, we are considering adding
> a separate SCSI hard drive, or maybe a RAID 1 system, and have
> sql server log to that instead.
RAID 1 at the least. Don't use a single drive in this case.
> My question is, what happens if that secondary drive or array
> completely fails. Let's say it melts. Assuming the OS doesn't
> crash (Windows 2003 Server), what will SQL Server 2000 do when
> the drive stops working and it is trying to write its data
> logging to it? Will it continue to function and write alert
> events? Will it shutdown? If it shuts down, how do we alter its
> configuration to tell it to use another drive for the logs?
It will stop running. It can't write anything. Just the same as if you
lost your data drive.
At that point you pull out your disaster recovery plan and go from here.
We've had a few cases where either the log or data disks went off-line and
it was just a matter of bringing them back online through the RAID
controller interface. SQL 2000 picked up where it left off.
> Also, what kind of throughput would we need to be doing to see
> any kind of benefit to making this change? It is easier to
> justify the expense of another disk or RAID setup if it is
> actually going to matter. ;-)
> Thanks all!
> Thomas|||"Greg D. Moore \(Strider\)" <mooregr_deleteth1s@.greenms.com> wrote in message news:<kStvc.34031$j24.13232@.twister.nyroc.rr.com>...
> "Thomas" <thomas-ggl-02@.data.iatn.net> wrote in message
> news:a9081691.0406021521.54c0f399@.posting.google.c om...
> > My question is, what happens if that secondary drive or array
> > completely fails. Let's say it melts. Assuming the OS doesn't
> > crash (Windows 2003 Server), what will SQL Server 2000 do when
> > the drive stops working and it is trying to write its data
> > logging to it? Will it continue to function and write alert
> > events? Will it shutdown? If it shuts down, how do we alter its
> > configuration to tell it to use another drive for the logs?
> It will stop running. It can't write anything. Just the same as if you
> lost your data drive.
> At that point you pull out your disaster recovery plan and go from here.
> We've had a few cases where either the log or data disks went off-line and
> it was just a matter of bringing them back online through the RAID
> controller interface. SQL 2000 picked up where it left off.
Let's imagine that this new RAID 1 for the logging goes down hard,
controller malfunction or what have you, and it will take a few days
to be repaired. In the meantime our data drive is working fine, and
we want to move the logging back to that array. You mentioned that
SQL Server would "stop running." If it isn't running, how would we
be able to update its configuration to change the location of the
logfiles?
Thanks for your feedback and advice!
Regards,
Thomas|||"Thomas" <thomas-ggl-01@.data.iatn.net> wrote in message
news:4f2cac50.0406030702.4308cd27@.posting.google.c om...
> "Greg D. Moore \(Strider\)" <mooregr_deleteth1s@.greenms.com> wrote in
message news:<kStvc.34031$j24.13232@.twister.nyroc.rr.com>...
> > "Thomas" <thomas-ggl-02@.data.iatn.net> wrote in message
> > news:a9081691.0406021521.54c0f399@.posting.google.c om...
> > > My question is, what happens if that secondary drive or array
> > > completely fails. Let's say it melts. Assuming the OS doesn't
> > > crash (Windows 2003 Server), what will SQL Server 2000 do when
> > > the drive stops working and it is trying to write its data
> > > logging to it? Will it continue to function and write alert
> > > events? Will it shutdown? If it shuts down, how do we alter its
> > > configuration to tell it to use another drive for the logs?
> > It will stop running. It can't write anything. Just the same as if you
> > lost your data drive.
> > At that point you pull out your disaster recovery plan and go from here.
> > We've had a few cases where either the log or data disks went off-line
and
> > it was just a matter of bringing them back online through the RAID
> > controller interface. SQL 2000 picked up where it left off.
> Let's imagine that this new RAID 1 for the logging goes down hard,
> controller malfunction or what have you, and it will take a few days
> to be repaired. In the meantime our data drive is working fine, and
> we want to move the logging back to that array. You mentioned that
> SQL Server would "stop running." If it isn't running, how would we
> be able to update its configuration to change the location of the
> logfiles?
Well, first of all, if you lose your log device, you have to do a restore
from backup in any case. At that point simply restore the backup to a
different device using the MOVE option.
Now, if your master DB and other system DBs are on the failed device, you
need to startup SQL server manually and specify on the command line where
they are.
MS has multiple KB articles on this.
Turn the question around... what happens if the RAID device with your DATA
fails? (ironically in some ways this can be EASIER to recover from assuming
you have good backups.)
> Thanks for your feedback and advice!
> Regards,
> Thomas