Discussion:
TSQLConnection.Connected := True always fails when first executed
(too old to reply)
Nando
2008-05-09 16:26:06 UTC
Permalink
Hi all,

I don´t know how to solve this trouble: When application starts and
TSQLConnection trys to connect to de database, for the very first time it
executes SQLConnection.Connected := True, it fails (Lock out time). If I
make a loop managing the exception and try once more to connect, it connects
ok.

Any help will be aprreciated.

Nando
Cesar Romero
2008-05-09 19:38:51 UTC
Permalink
Post by Nando
Hi all,
I don´t know how to solve this trouble: When application starts and
TSQLConnection trys to connect to de database, for the very first
time it executes SQLConnection.Connected := True, it fails (Lock out
time). If I make a loop managing the exception and try once more to
connect, it connects ok.
Any help will be aprreciated.
RunTime or DesignTime?

If in RunTime, probably the default connection params is wrong, try set
the connection params in OnBeforeConnect event.
--
Cesar Romero
http://blogs.liws.com.br/cesar

[AsyncCalls 2.0 unit]
[Codegear Comprada pela Embarcadero]
[Processadores multi core no desktop]
[RtlVclOptimize 2.76]
[Turbo Power Newsgroup]
http://blogs.liws.com.br/cesar/?feed=rss2
Nando
2008-05-12 23:15:00 UTC
Permalink
Hi Cesar,

Thank you for your post.

following is an example of the connection parameters:

ConnectionName=cMs_MyConnection
DriverName=dMs_MyConnection
GetDriverFunc=getSQLDriverMSSQL
LibraryName=dbxmss30.dll
LoginPrompt=False
VendorLib=oledb
Params="HostName=myHost","Database=myDataBase","Password=theUser","User_Name=thePassw"
UserSchema=dbo

This is de exception message:

Debugger Exception Notification:
exception class TDBXError with message 'SQL State: HYT00, SQL Error Code:
0
Wayt Time Out'
Post by Cesar Romero
RunTime or DesignTime?
Both. It is because the application must define connection parameters at
runt time. It should be able for connecting with several different
servers/databases one before the other.

Definning connection params in OnBeforeConnect event does´t change.


Nando
Bill Todd [TeamB]
2008-05-09 22:27:50 UTC
Permalink
What database?

Whose driver (CodeGear or a third party)?

Any error message?

What connection parameters are you using?

Are you connecting across a LAN, WAN, VPN?
--
Bill Todd (TeamB)
Nando
2008-05-12 23:17:06 UTC
Permalink
Bill, once more thank you for your post.

Database MS-SQL Server 2003.
Windows Server 2003.

following is an example of the connection parameters:

ConnectionName=cMs_MyConnection
DriverName=dMs_MyConnection
GetDriverFunc=getSQLDriverMSSQL
LibraryName=dbxmss30.dll
LoginPrompt=False
VendorLib=oledb
Params="HostName=myHost","Database=myDataBase","Password=theUser","User_Name=thePassw"
UserSchema=dbo

This is de exception message:

Debugger Exception Notification:
exception class TDBXError with message 'SQL State: HYT00, SQL Error Code:
0
Wayt Time Out'

The the application must define connection parameters at runt time. It
should be able for connecting with several different servers/databases one
before the other.

Nando
Bill Todd [TeamB]
2008-05-13 15:05:26 UTC
Permalink
I have not used dbExpress with SQL Server 2005. My only suggestion is
to set up the default connection at design time and make sure your
properties match.
--
Bill Todd (TeamB)
Loading...