But, other DSNless connections to different databases on the same database
server work from the same client.

Very odd.

Also, I updated my MDAC drivers about 2 months ago. All of my code had been
working up until just yesterday.

I'm willing to reinstall the MDAC drivers to see if that solves the problem.
When I run the component checker tool I do find some mismatches between the
version of MDAC RTM and the files that are registered.

I'm going to upgrade and see if I can get all of the files to the expected
levels.



-----Original Message-----
From: Edward Moon [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 11, 2001 1:21 AM
To: Ron Rohrssen
Cc: Dbi-Users
Subject: Re: DSN vs. DSNless connection


This often due to something updating (or downgrading) ODBC drivers.

You might want to upgrade to the latest and greatest MDAC from
<http://www.microsoft.com/data/download.htm>

On Wed, 10 Oct 2001, Ron Rohrssen wrote:

> Hello.
>
> I have a piece of code that uses a DSNless connection to a SQL Server
> database. This code has been working just fine until just a few hours ago.
>
> Suddenly, the database connection dies with this error:
> Invalid string or buffer length (SQL-S1090)(DBD: db_login/SQLConnect
err=-1)
>
> I stripped the code down to the bare minimum and still this connection
will
> not work.
>
> Even more strangely, the code WILL work on a couple of NT servers. But,
the
> code will not work on a Win NT workstation or Win 98 machine. Ummm....
>
> If I convert the code to a DSN connection everything works fine.
>
> So, my question is....
>
> What happened to my Perl installation that is causing this error?
>
> Here's the stripped down code which does not work as a DSNless connection.
> -----------------------------------------
> use strict;
> use DBI;
>
> my ($strDBServer, $dsnSQL_Server, $dbhSQL_Server);
>
> $dsnSQL_Server = "Driver={SQL
> Server};Server=rpt-nt01;Database=DatabaseName";
>
> $dbhSQL_Server = DBI->connect("dbi:ODBC:$dsnSQL_Server", "UserID",
> "UserPassword",
>           {RaiseError => 1, PrintError => 1, AutoCommit => 1
>           } ) or die "Connection to SQL Server Application Support
database
> failed: " . $DBI::errstr . "\n";
>
>
> $dbhSQL_Server->disconnect;
> -----------------------------------------
>
> Pretty simple. If you change the server name, databasename, userid, and
> userpassword to your environment this should connect to the database and
> disconnect without a problem as it does on 2 of my NT servers.
>
> Ron Rohrssen
>

Reply via email to