Solved

Parameter settings for BDE

Posted on 2003-11-19
11
3,832 Views
Last Modified: 2013-11-23
Writing in Delphi on Windows 2000
Using BDE to access a MS/SQL database
I am still confused of which value setting is really used : the one defined in the BDE settings (BDE administrator) or the one via the Params property (Values[...]) of the TDatabase object which is used ?
Putting TIMEOUT to 20 in the BDE admin setting and the same to 5 at execution time shows that the one which is taken into account is through the BDE (I just issued a very long query in my exe and it failed on time out, but after 20 seconds, not 5).
My real problem is that I want to have it setup at run time !
0
Comment
Question by:LeTay
  • 7
  • 4
11 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9780001
you must close and reopen the tdatabase to get the effect

meikl ;-)
0
 

Author Comment

by:LeTay
ID: 9785548
This is was I do, indeed.
My application is a command line exe which accepts a parameter /t:n which means to put a time out of n seconds on the query. If error at execution due to the time out, I display an error message saying 'time out on query'
Now step by step
1. BDE Administrator -> timeout 10 -> save -> exit
2. From a prompt : myapp.exe /t:2 (the app runs a query that takes at least 15 seconds to answer)
3. I get Time out on query after +/- less 10 seconds
4. BDE Administrator -> timeout 2 -> save -> exit
5. From a prompt : myapp.exe /t:10
6. I get Time out on query after +/- less 2 seconds
This proves that the BDE takes the setting into account according the the BDE setup, not my program...
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9785642
which components do you use?

your tquery must be linked to your tdatabase and not to the alias,
whereas your tdatabase may linked to the alias, but
the alias-parameters are then overwritten with the TDatabase-parameters

meikl ;-)
0
Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

 

Author Comment

by:LeTay
ID: 9786858
Here is part of the coding that shows you what is used (no alias etc...).
I setup a lot of these Params.Values and these are taken into account (user name, password etc...)
ps : there is maybe a monitoring tool to see what happens ?

.../...
 DB1:TDatabase;
 SP:TStoredProc;
.../...
 with DB1 do
  begin
   DatabaseName   := 'MyDataBase';
   AliasName      := '';
   DriverName     := 'MSSQL';
   KeepConnection := True;
   LoginPrompt    := False;
   SessionName    := SessionName;
   with Params do
    begin
     Values['DATABASE NAME']      := 'MyDataBase';
     Values['APPLICATION NAME']   := 'Duplicates';
     Values['SERVER NAME']        := 'MyServer';
.../...
     Values['TIMEOUT']            := TimeOut;
    end;
.../...
 with SP do
  begin
   DatabaseName   := DB1.DatabaseName;
   StoredProcName := 'MyStoredProcedure';
   Params.Clear;
.../...
  end;


0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9787027
hmm,
looks all correct

i did a bit recherche:
---- from delphi helpfile
property Params: TStrings;

Description

Use Params to examine or specify database connection parameters, such as path name, server name, schema-caching size, language driver, user name, and password. Actual parameters in Params differ depending on the current BDE alias and driver for the database component.

Params is a list of string items, each representing a different database connection parameter. If the AliasName property specifies a valid BDE alias, then Params automatically contains the parameters defined for that alias. If, instead of providing an alias, an application uses the DriverName property to provide a local alias, the application must provide Params values directly.

Note:      Applications can use Params to override the default settings supplied by a BDE alias.
Tip:      At design time double-click a TDatabase component to invoke the Database editor and set Params.
--------
i followed the tip, and in this dialog is a "Defaults"-Button
which lists this
list of default-parameters from the MSSQL-Driver
-------
DATABASE NAME=
SERVER NAME=MSS_SERVER
USER NAME=MYNAME
OPEN MODE=READ/WRITE
SCHEMA CACHE SIZE=8
BLOB EDIT LOGGING=
LANGDRIVER=
SQLQRYMODE=
SQLPASSTHRU MODE=SHARED AUTOCOMMIT
DATE MODE=0
SCHEMA CACHE TIME=-1
MAX QUERY TIME=300
MAX ROWS=-1
BATCH COUNT=200
ENABLE SCHEMA CACHE=FALSE
SCHEMA CACHE DIR=
HOST NAME=
APPLICATION NAME=
NATIONAL LANG NAME=
ENABLE BCD=FALSE
TDS PACKET SIZE=4096
BLOBS TO CACHE=64
BLOB SIZE=32
PASSWORD=
----------------
timeout is not in the list,
so i guess this parameter cannot overloaded with TDatabase-Params

serching on the net now

meikl ;-)
0
 

Author Comment

by:LeTay
ID: 9787245
Looks like you are right.
I did another test with te CONNECT TIMEOUT.
Same result, and like TIMEOUT, not in this list.
If it appears to be not modifiable, this is really a pitty.
But whatever the final real solution/reason is, I think you will get the points...
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9787434
there may be a chance to set the driver-parameter with the bde-api,
trying it now, be patient, this may take some time
0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 250 total points
ID: 9788017
hi,
bad news,
i can retrieve the value, but i can't set it :-(
(the api has no method for this)

meikl ;-)
0
 

Author Comment

by:LeTay
ID: 9795636
Well, shall be abandon ?
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 9795659
let us wait, until weekend is finished
(will do at weekend a new try)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 10776382
oops, sorry,
missed the feedback :-))

but found no way, sorry

meikl ;-)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to convert wav to mp3 in delphi 9 196
Create a path if not exists 7 76
Dev express lookupcombo 3 26
Slow Restore if incremental backups using RDiff.exe 4 17
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now