Op donderdag 24-01-2008 om 20:56 uur [tijdzone +1100], schreef John:
> Joost van der Sluis wrote:
> > Op donderdag 24-01-2008 om 00:09 uur [tijdzone +1100], schreef John:
> >   
> Snip
> >> It does, in so far as the parameter specs are now retained, but now the 
> >> database property of sqlquery is not read, so it still can't work 
> >> properly.  In fact, I can't even set the database from the Lazarus 
> >> object inspector.
> >>     
> >
> > Huh? Are you sure? Did you recompile everything correclty?
> >   
> You won't often catch me saying "Yes I am *sure* I compiled everything 
> correctly" !  I think I did, though.

Quick test is to add a new writeln, see if it is triggered. If so you
have rebuild it properly.

> This is my version of set database:

It doesn't contain a call to Inherited.SetDatabase. I think that that is
your problem now.

> procedure TCustomSQLQuery.SetDatabase(Value : TDatabase);
> 
> var db : tsqlconnection;
> 
> begin
>   if (Database <> Value) then
>     begin
>     {$IFDEF DBDEBUG}
>     if dbdbgOn then
>       Writeln(dbdbg, 'TCustomSQLQuery.database is being set to "',
>                      Value.DatabaseName, '".');
>     {$ENDIF}
>     if assigned(value) and not (Value is TSQLConnection) then
>       DatabaseErrorFmt(SErrNotASQLConnection,[value.Name],self);

Add   '  inherited setdatabase(value);'


>     if not (csLoading in ComponentState) then
>       begin
>       UnPrepare;
>       if assigned(FCursor) then 
> TSQLConnection(DataBase).DeAllocateCursorHandle(FCursor);
>       db := TSQLConnection(Value);
>       if assigned(value) and (Transaction = nil) and 
> (Assigned(db.Transaction)) then
>         transaction := Db.Transaction;
>       {$IFDEF DBDEBUG}
>       if dbdbgOn then
>         Writeln(dbdbg, 'Calling TCustomSQLQuery.OnChangeSQL because ',
>                        'TCustomSQLQuery.database has been set to "',
>                        Value.DatabaseName, '".');
>       {$ENDIF}
>       OnChangeSQL(Self);
>       end;
>     end;
> end;

Joost

_________________________________________________________________
     To unsubscribe: mail [EMAIL PROTECTED] with
                "unsubscribe" as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives

Reply via email to