SQL Server Problem.(SQL-28000)

------=_NextPart_000_0033_01C12642.735DD1F0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Hello,

I'm a newbie here and have a question regarding the use of
DBI::ODBC with SQL Server.  I've checked the mail archives
and seen others with the same problem but have yet to
come across the solution.

Here's what I'm doing: (note: actual user name and password have been
changed here).

use DBI;
my %attr = (
    PrintError => 1,
    RaiseError => 1
    );

$dbh = DBI->connect("dbi:ODBC:LocalServer", "user", "password". \%attr)
    or die "Can't connect to DataBase: ", $DBI::errstr, "\n";

....

Here's the error:

DBI->connect(LocalServer) failed: [Microsoft][ODBC SQL Server Driver][SQL
Server]Login failed for user 'user'. (SQL-28000)(DBD: db_login/SQLConnect
err=-1)
Can't connect to DataBase: [Microsoft][ODBC SQL Server Driver][SQL
Server]Login failed for user 'user'. (SQL-28000)(DBD: db_login/SQLConnect
err=-1)


I've done the following:

1) Verified that a valid DSN exists for LocalServer.
2) Verified that user and password are configured properly in the DSN.
3) Verified that the SQL Server Database is correct.
4) Tested the ODBC Data Source is correct through the ODBC Administrator.

I'm using Win2K and SQL Server 7.

I'm trying to avoid using the WIN32:ODBC but I have used it successfully.

Thoughts, Comments, Dirty Remarks?

Thanks,

Carter.

--
Carter A. Thompson
Lead Release Engineer
Voxeo Corporation
http://www.voxeo.com
(831) 461-4925


------=_NextPart_000_0033_01C12642.735DD1F0--

0
cartert
8/16/2001 5:58:58 PM
perl.dbi.users 11098 articles. 1 followers. Follow

1 Replies
1006 Views

Similar Articles

[PageSpeed] 40

Carl,

The connection doesn't get its username and password attributes from the
DSN, so that wouldn't matter. It does, however get its other connection info
from the DSN.

If you have copied your code directly, then you have an error.... you wrote

> $dbh = DBI->connect("dbi:ODBC:LocalServer", "user", "password". \%attr)
>     or die "Can't connect to DataBase: ", $DBI::errstr, "\n";

this shows you concatenating the password with the address of the %attr
hash. This is probably why our password is wrong. It would be coming in as
passwordHASH(0x1246) or something.

Also if you are using the LocalServer you may want to make another DSN
specifically for your machine's ip address instead of using LocalServer DSN.

Hope this helps

Hugh J. Hitchcock
Programmer / Developer


        my $dbh = DBI->connect('DBI:ODBC:MyDSN','sa','pass')
                or die "Couldn't connect to database: " . DBI->errstr;



> -----Original Message-----
> From: Carter A. Thompson [mailto:cartert@voxeo.com]
> Sent: Thursday, August 16, 2001 1:59 PM
> To: DBI-Users
> Subject: SQL Server Problem.(SQL-28000)
>
>
> Hello,
>
> I'm a newbie here and have a question regarding the use of
> DBI::ODBC with SQL Server.  I've checked the mail archives
> and seen others with the same problem but have yet to
> come across the solution.
>
> Here's what I'm doing: (note: actual user name and password have been
> changed here).
>
> use DBI;
> my %attr = (
>     PrintError => 1,
>     RaiseError => 1
>     );
>
> $dbh = DBI->connect("dbi:ODBC:LocalServer", "user", "password". \%attr)
>     or die "Can't connect to DataBase: ", $DBI::errstr, "\n";
>
> ...
>
> Here's the error:
>
> DBI->connect(LocalServer) failed: [Microsoft][ODBC SQL Server Driver][SQL
> Server]Login failed for user 'user'. (SQL-28000)(DBD: db_login/SQLConnect
> err=-1)
> Can't connect to DataBase: [Microsoft][ODBC SQL Server Driver][SQL
> Server]Login failed for user 'user'. (SQL-28000)(DBD: db_login/SQLConnect
> err=-1)
>
>
> I've done the following:
>
> 1) Verified that a valid DSN exists for LocalServer.
> 2) Verified that user and password are configured properly in the DSN.
> 3) Verified that the SQL Server Database is correct.
> 4) Tested the ODBC Data Source is correct through the ODBC Administrator.
>
> I'm using Win2K and SQL Server 7.
>
> I'm trying to avoid using the WIN32:ODBC but I have used it successfully.
>
> Thoughts, Comments, Dirty Remarks?
>
> Thanks,
>
> Carter.
>
> --
> Carter A. Thompson
> Lead Release Engineer
> Voxeo Corporation
> http://www.voxeo.com
> (831) 461-4925
>
>

0
hugh
8/16/2001 6:11:00 PM
Reply:

Similar Artilces:

SQL Server 2005 Installation problems with SQL Server Express & SQL Server 2000
Hi Guys, I have had SQL Server Express and Sql Server Management Studio Express installed on my machine for some time and recently tried to install a trial of SQL Server 2005 as well.  (Yes, I'm migrating from Visual Studio Express to Visual Studio Professional, just as in tended!) Everything went fine except that nothing seemed to be installed.  I searched in all the obvious places - both on the Start/Programs menu and on the hard-drive: nothing. A check under Add/Remove Programs showed that Sql Server 2005 Express was installed, but called SQL Server 2005. So after a number o...

[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
Hello All, I'm Getting the following error when calling a dll from my vb.net application. [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection. The dll was written in vb6 and accesses a sql db using the following connection string. Public Const GLOBAL_DNS As String = "DSN=TransSrvFinal;UID=sa;PWD=admin;" This DLL works fine when called from other Windows Apps. However I'm now trying to call this dll from with in an asp.net application. I'm using vb.net as the codebehind. I'm a...

SQL Server Express deployed to SQL Server Problem
I am developing an application using VWD 2005 Express with SQL Server 2005 Express. The application works fine on my development box. My production box is running the full-blown SQL Server with ASP.Net 2.0 and IIS. I'm having problems getting the database connection correct. The SQL Server on the production box does not recognize the SQL Server 2005 Express (SSE) *.mdf file. I tried attaching the SSE *.mdf file to the SQL Server, but I get an error message. Has anyone had this experience? Can anyone give me some suggestions. It seems like I should be able to attach an *.mdf file cre...

Problem with defaults and User defined datatype in SQL Server 2000 or SQL 7
why does powerdesigner create a default in the definition of a table like this (SQL 2000 or 7.5 don't allow it). I use PD7.5.0.826 create table dbo.STOCK ( STOCKID TStockId not null, Goods TGoods not null, Amount TAmount not null default 'create default D_TAmount as 0',, constraint PK_STOCK primary key (STOCKID) ) go Anybody got a clue to fix the definition file to use the correct syntax Found the problem, it was and error introduced after reading models created from ...

Stored procedure problem after I move from sql server to sql server 2005
Hi, Guys     I have a problem with a stored procedure. When I used sql express. there was no problem but after I change server from sql express to sql server 2005, I have an error message. The followings are source code and error message when I run program. Please help me to figure it out. This is a behind code in VB Dim tmpchkno As TextBox = FormView1.FindControl("txtchecknoin") Dim tmpchkdate As TextBox = FormView1.FindControl("txtcheckdatein") Dim sqlcon As New SqlClient.SqlConnection Dim sqlcmd...

Problems attaching .mdf (SQL Server 2005) to SQL Server 2008
I've attached my mdf file from SQL Server Express 2005 to SQL Server 2008 and it created the new database but there are no tables or anything in it.  Will it work better with a backup file instead or in addition to the mdf?  Or have I done something wrong from the start. Check your permissions on the SQL 2008 machine make sure that you are listed in the Security > Users for the database.- WilliamPlease mark the most helpful reply/replies as "Answer".Give some of my PWSK modules a try. You should be able to attach SQL Server 2005's mdf file to a SQL Server ...

Could not add ASPNET user to SQL Server.SQL Server does not exist or access denied.
I downloaded the IBUYSPY ecommerce application today, but it will not add the aspnet user to SQL Server. I am using the MSDE version of SQL server 2000 and I changed the password as specified to do, but it will not work. Does anyone have any suggestions. 5:30:25 PM Monday, March 15, 2004: [Checking system requirements] 5:30:25 PM Monday, March 15, 2004: [Pass] Detected a local instance of SQL Server. 5:30:25 PM Monday, March 15, 2004: [Pass] Determined SQL Server version (8.00.194). 5:30:25 PM Monday, March 15, 2004: [Pass] Detected .NET Framework. 5:30:25 PM Monday, Mar...

This version of Microsoft Sql Server Management Studio can only be used to connect to Sql Server 2000 and Sql Server 2005 servers
When I connect SQL Server 2005 to a remote database i get the error: "This version of Microsoft Sql Server Management Studio can only be used to connect to Sql Server 2000 and Sql Server 2005 servers". Can I confirm it is because: the remote db is of SQL Server 2008? There is a soln mentioned in http://forums.asp.net/t/1324047.aspx Did anybody try this (installing 2008 express: http://www.microsoft.com/express/sql/download/)? I am just checking again, whether it will disturb my existing SQL Server installation, in any means...? Though it is mentioned that it will g...

Could not add ASPNET user to SQL Server.SQL Server does not exist or access denied.
I downloaded the IBUYSPY ecommerce application today, but it will not add the aspnet user to SQL Server. I am using the MSDE version of SQL server 2000 and I changed the password as specified to do, but it will not work. Does anyone have any suggestions. 5:30:25 PM Monday, March 15, 2004: [Checking system requirements] 5:30:25 PM Monday, March 15, 2004: [Pass] Detected a local instance of SQL Server. 5:30:25 PM Monday, March 15, 2004: [Pass] Determined SQL Server version (8.00.194). 5:30:25 PM Monday, March 15, 2004: [Pass] Detected .NET Framework. 5:30:25 PM Monday, ...

Problem deploying site developed with Sql Ex. To server running Sql Server 2005.
Can someone show me, or direct me, to a source,  that shows me how, and what to change,  when deploying a website from a development server running Sql Ex to a production server running Sql server 2005.  I can’t get the sites to run under Sql server 2005.   They work in Sql Ex. what must I change?  The connection string, to what format?  and what else?  I attached the dB to Sql 2005 and browsed the content in the Sql manager.  But can’t get the aspx pages to work on the server.   Help please The connection string format of SQL 2005...

Problem with showing diagrams when attaching a Sql Server 2000 database in Sql Server 2005
I have a database created in MS SQL Server 2000 with some tables and diagrams.I have attached that database in SQL Server 2005 but when i want to access and showthe diagrams i face the following error message :Database diagram support object can not be installed because this database does not havevalid owner,to continue first use the files page of database dialog box or alter the authorizationstatement to set the database owner to valid login then add the database diagram support object.I have created a role with required permissions but i still have the problem(I still can't show the di...

SQL Server 2000 and SQL Server 2005 in the same server
Can enyone please send me a link to a white paper explaining how to run both SQL Server 2000 and 2005 in the same machine?Thanks. I don't know about the white paper but I had both running on my machine for a while by making the SQL 2000 a named instance. So for SQL 2005 connection strings my server name was (local) while for SQL 200 using the named instance it was (local)\joesql where joesql was the instance nameHope it helps,Joe http://www.joeaudette.comhttp://www.mojoportal.com...

2008 IIS7 connection to SQL Server 2000 on Web Server 2000: Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
I am setting up a windows 2008 IIS7 web server, and trying to connect to a windows 2000 sql server 2000 database. I have an IIS6 Windows 2000 web server activately connected just fine. I have anonymous and windows authentication enabled. And in my web.config I have identity impersonate="true" My sql server 2000 typically uses the IISUSER anonymous user set up in IIS6 on my original windows 2000 web server. But this new IIS7 is giving me grief. I can't seem to setup the IUSR or IISUSER or anything in it. I can't even use sql server credentials in my connection string altho...

Problems SQL Server -> SQL Anywhere
We have a strange problem when moving from MS SQL Server to SQL Anywhere. Can anyone help us with this problem Environment: Windows XP Sp1 Visual C++ 6.0 Adaptive Server Anywhere 8.0 ODBC driver 8.00.01.2600 Problem: I have derived a recordset class from CRecordset, and is using bulk row fetching. The data from the database is fetched in batches of 25 rows (default recordset size). If I terminate the operation when x rows are handled, the remaining (25-x) rows will turn up in the first batch when I restart the operation. All is well so far, but the first batch will hold ...

Web resources about - SQL Server Problem.(SQL-28000) - perl.dbi.users

Resources last updated: 1/3/2016 5:02:48 PM