Page 1 of 1

The unknown symbol '' $01

Posted: Mon 24 Jul 2006 20:58
by PilleSoft
Hello,

i use Delphi4 (Upd3) with SDAC-Components for MS-SQL.

By using the Query-Component i have this Error:
Im Projekt test.exe ist eine Exception der Klasse Exception aufgetreten. Meldung: 'Parser: The unknown symbol '' $01'. ProzeƟ wurde angehalten. Mit Einzelne Anweisung oder Start fortsetzen.

This is the Source

Code: Select all

   with dmMain.msqFunktion do begin 
     SQL.Clear; 
     s :=     ' select max(bs_verlauf_id) as bs_verlauf_id '; 
     s := s + '   from bs_verlauf, bs_termine, bs_zeitraum '; 
     s := s + '  where bs_verlauf.bs_termine_id = bs_termine.bs_termine_id '; 
     s := s + '    and bs_termine.bs_zeitraum_id = bs_zeitraum.bs_zeitraum_id '; 
     s := s + '    and bs_verlauf.bibelschule_id = ' + BS_ID; 
     s := s + '    and bs_zeitraum.bs_zeitraum_id = ' + inttostr(RZ.zeitraum_id); 
     SQL.Add(s); 
     try 
       Execute; //HERE IT COMES TO THE ERROR (sometimes!!!) 
     except 
          end; 
     if not Eof then 
       Result := dmMain.msqFunktion.FieldByName( 'bs_verlauf_id' ).AsString; 

     Close; 
   end; 



The Variable BS_ID is String and RZ.zeitraum_id is Integer with valid values.

The Problem ist, that the Error comes some times, but the most times the SQL-Script works fine.

Greetings
Karsten

ps: sorry about my english. My 2nd language is Pascal ;-)

Posted: Tue 25 Jul 2006 07:26
by Antaeus
Most likely value of S_ID causes this problem. Try to use parameters instead. As a rule usage of parameters is more convenient than forming query like presented in the code above.

Testing Parameters

Posted: Wed 26 Jul 2006 11:05
by PilleSoft
By using paramters it's the same problem - sorry. But thank's 4 help.

Posted: Wed 26 Jul 2006 13:36
by Antaeus
Please supply us with exact version of SDAC you use.