Search found 11 matches

by BigAl66
Tue 26 Jul 2011 06:02
Forum: SQL Server Data Access Components
Topic: Executing OnCalcFields without refreshing non-calced-fields
Replies: 4
Views: 1440

Hi Andrey,

again. I tried it and it works :D - but also just calling Resync([]) do work? The calculated fields are updated and no access to the database is monitored. Is there any reason why not use just Resync?

Regards

Alex
by BigAl66
Mon 25 Jul 2011 16:59
Forum: SQL Server Data Access Components
Topic: Executing OnCalcFields without refreshing non-calced-fields
Replies: 4
Views: 1440

Hi Andrey,

thank you very much for you reponse. I will try your solution.

Best Regards

Alex
by BigAl66
Sun 24 Jul 2011 09:21
Forum: SQL Server Data Access Components
Topic: Executing OnCalcFields without refreshing non-calced-fields
Replies: 4
Views: 1440

Executing OnCalcFields without refreshing non-calced-fields

Hi,

I try to recalc all fields of a TMSQuery without refreshing the data from the database server. The background is, that I have a field, that is dependet from the current time. Example:

DB-Field 1: TStart: TDateTime;
DB-Field 2: TStop: TDateTime;
Calc-Field: Duration: TDateTime;

In the OnCalc-Event the Duration will be calced as follows ():

Code: Select all

if not TStop.IsNull then
  Duration.AsDateTime := TStop.AsDateTime - TStart.AsDateTime
else
  Duration.AsDateTime := Now - TStart.AsDateTime;
Calling a Refresh of the query will update all fields but will allways execute also a complete refresh to the SQL-Server... My data is displayed in a TDBCtrlGrid. Therefore I need a dataaware component to display the field...

Any idea?

Alex
by BigAl66
Tue 05 Jul 2011 12:07
Forum: SQL Server Data Access Components
Topic: Parameter of stored procedure lost...
Replies: 5
Views: 1528

Hi,

I found the problem. Changing the procedure in the SQL-Server will not update the call parameters in the TMSStoredProc object. After I changed to another stored procedure and go back to original one, the parameters look ok.

Thank you verry much for your fast and professional help!

Alex
AndreyZ wrote:Please try using the following code:

Code: Select all

MSStoredProc.StoredProcName := 'stor_proc_name';
MSStoredProc.PrepareSQL;
MSStoredProc.ParamByName('xxx').AsString := 'test';
MSStoredProc.Open;
by BigAl66
Tue 05 Jul 2011 09:59
Forum: SQL Server Data Access Components
Topic: Parameter of stored procedure lost...
Replies: 5
Views: 1528

Hi,

this do only partly work. The parameter will no not be lost anymore. But I can still not access it. I get always the error "Parameter 'xxx' not found'... :(

Any other idea?

Alex
AndreyZ wrote:Hello,

The point is that SDAC uses the @ symbol for working with parameters. To avoid both problems (here and http://www.devart.com/forums/viewtopic.php?t=21420), you should alter your procedure in the following way:

Code: Select all

ALTER PROCEDURE [dbo].[] 
@xxx INT 
AS 
BEGIN
...
After this, to access a parameter by name, you should use the following code:

Code: Select all

MSStoredProc.ParamByName('xxx').AsString := 'test';
by BigAl66
Tue 05 Jul 2011 07:29
Forum: SQL Server Data Access Components
Topic: Accessing Parameter of TMSStoredProc by name...
Replies: 1
Views: 1238

Accessing Parameter of TMSStoredProc by name...

Hi,

I use a TMSStorecProc and try to change the parameters with ParamByName. I get an exeption "paramter not found". The params of the stord procedure are displayed as '@xxx'. When I try to access '@xxx' or 'xxx' I get the error. If I try

.ParamByName(.Params.Items[1].Name)...

I get the same error ( is my TMSStoredProc).

The stored procedure is defined like:

ALTER PROCEDURE [dbo].[]
@@xxx INT
AS
BEGIN
...

I tried also using @xxx instead @@x.

What's going wrong? In the moment I access the parameter as ...Param[1].Value. But this is only a workaround. If the Parameters of the storec proc changes in the futere then (non) funny things can happen...

Alex
by BigAl66
Tue 05 Jul 2011 06:30
Forum: SQL Server Data Access Components
Topic: Parameter of stored procedure lost...
Replies: 5
Views: 1528

Parameter of stored procedure lost...

Hi,

I have a small problem:

I open a stored procedure using the TMSStoredProc object. Everything works fine. Only the parameters I specified where lost all the times. When I open the MSStoredProc Editor and specify my parameters I can access my data. When I close the editor and open it again, the parameters where set to "NULL".

Is it a bug?

Alex
by BigAl66
Sun 20 Feb 2011 22:10
Forum: SQL Server Data Access Components
Topic: TMSSQLMonitor is not working...
Replies: 6
Views: 1430

Hi,

everything is now working. I don't know exactly why. I just renamed my application (stored under a new name). I have not found the real problem. The first idea of all that read this is (I think) that the firewall has blocked the communication between the monitor and the application. But this is not the reason...

However... It works now :-)

Best Regards

Alex
by BigAl66
Fri 18 Feb 2011 22:43
Forum: SQL Server Data Access Components
Topic: TMSSQLMonitor is not working...
Replies: 6
Views: 1430

Ok, I've debugged the code and found, that the socket in TSocketMessagePacker cannot be opened:

FSocket := socket(AF_INET, SOCK_STREAM, 0);

FSocket results in -1. The error i get (GetSocketError) is 10106. I'm checking now why... If I find the reason I will report...

Alex
by BigAl66
Thu 17 Feb 2011 23:07
Forum: SQL Server Data Access Components
Topic: TMSSQLMonitor is not working...
Replies: 6
Views: 1430

Hi,

I'm desperatet. No chance to get it work. In a new application it works perfect. The Monitor and the Connection are placed on a datamodule. I tried this also in a new application - there it works. I tried also to initialize the datamodule prior all other units - no chance. I compared all the compiler settings to the new application - they are identical.

I'm out of ideas... I also own the source of SDAC. Do you have some tips how to isolate the problem? What is the way, the messages are transfered to the DBMonitor? If I start the application outside the IDE the monitor logs the data as expected.

Please help, because I have verry complex SQL-Statements to debug. They sometimes where build dynamicaly during runtime. As I told you at the start of this post: I'm desperated...

PS: The SQLMonitor (option moSQLMonitor) is not working at all...

Best Regards

Alex
by BigAl66
Thu 10 Feb 2011 18:49
Forum: SQL Server Data Access Components
Topic: TMSSQLMonitor is not working...
Replies: 6
Views: 1430

TMSSQLMonitor is not working...

Hi,
I use des SDAC Components (Professional 5.00.0.4) together with the DBMonitor (3.0.3) in Delphi XE Professional. My OS is Win 7 Ultimate.

The TMSSQLMonitor-Component is not working in my application. Inside the IDE the events where transmitted to the DBMonitor. During runtime no message is logged.

Another thing I have is, that the queries, that where set to "Active" inside the IDE are not opened automaticaly when I start the runtime. I have to open them all manually (Query.Open).

When I create a new application everything works as expected!

What's going wrong? Any Idea?