|
Posted by Erland Sommarskog on 02/17/07 14:55
(kk035@hotmail.com) writes:
> It's just an internal application without any performance problems.
>
> strConnect="DSN=ODBC-datasourcename;UID=username;PWD=password"
>
> code snippet:
>
> set conDb = Server.CreateObject("adodb.connection")
> conDb.Open Session("strConnect")
> for each errDb in conDb.Errors
> if errDb.Number <> 0 then
> bDbError = true
> Session("strErrTxt1") = errDb.Description
> Session("strErrTxt2") = errDb.Source
> Session("strErrTxt3") = errDb.SQLState
> Session("strErrNbr1") = errDb.Number
> Session("strErrNbr2") = errDb.NativeError
> exit for
> end if
> errDb.Clear
> next
>
> -> err.Db contains no information
But what happens? Does it wait for 15 seconds and give up? Or does attempts
to use the connection fail?
And why use a DSN? Personally, I've never liked DSNs, it just one more
source of error. What is in that DSN?
What happens if you change the DSN part to Provider=SQLNCLI?
Where does the password come from? Is it hard-coded into the
application, or user-entered? Keep in mind that in SQL 2005, passwords
are always case-sensitive.
--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
[Back to original message]
|