-- 
Dipl. Phys. Jörg SchlägerZitat von Bo Berglund <bo.bergl...@gmail.com>:

>>
>> 1. Can you test a regular SELECT statement on the same SQL database ?
>>    If that doesn't work either, we know the problem is in the ODBC 
>> connection component.
>>
>> 2. Can you test the same EXEC statement in a Delphi app through ODBC ?
>>    If this gives problems, it means the ODBC driver is well - weird.
>>    (although this would surprise me)
>>
>> 3. If both previous attempts work, there is nothing left but to 
>> debug the ODBC connection component.
>>    That means stepping through your code with the debugger.
>>
>> Michael.
>
> I did this before too, but I have repeated it now by copying the
> procedure code into the application. The procedure differentiates the
> processing depending on the value of the argument, but I have copied
> the relevant select section into the lazarus project code.
>
> 'SELECT dr.SerialNo, da.AppNo, da.AppOption, da.AppInfo, da.ExpDate,
> da.ProgDate' +
> ' FROM DongleReg dr' +
> ' JOIN DongleAppData da' +
> ' ON da.DongleRegID = dr.DongleRegID' +
> ' WHERE dr.SerialNo = 2584' +
> ' ORDER BY da.AppNo ASC';
>
> As expected it runs just fine returning 4 records, in fact the
> query.RecordCount method actually shows this too. :-)
>
> Only problem is that our database contains a whole lot of procedures
> that return various kinds of data so I cannot really move that logic
> over to the GUI application code. I really need to be able to retrieve
> those records after sending an EXEC command (which now is legal in
> sqldb.pp after the patch is applied).
>
>
>
> --
> Bo Berglund
> Developer in Sweden
>

I used the following code in progs compiled with
delphi 5, delphi7 and delphi 2007 with winxp sp1 to win 7
with MSsql2000 and MSsql2005 without problem

  Listbox1.Clear;
  Query1.sql.Clear;
  Query1.sql.add('exec Aufnahme.dbo.L_Stat_Allgemein');
  Query1.open;
  while not Query1.eof do
    begin
    Listbox1.Items.Add(Query1.findfield('GSJ').AsString + ' - ' + 
Query1.findfield('Statistik').AsString );
    Query1.Next;
    end;
  Query1.Close;

exists  query.updatemode  in lazarus ? then it should be upWhereAll, because 
the exec or execute has no key

next switch on logging odbc 
and a diff of two logs between delphi prog and lazarus prog with one query with 
exec


----------------------------------------------------------------
Dip. Phys. Jörg Schläger
Auftragsentwicklung Meßtechnik
www.jsdevelop.de
--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to