[Lazarus] Accessing MS SQLServer database from Lazarus/FPC?

michael.vancanneyt at wisa.be michael.vancanneyt at wisa.be
Tue Jan 25 09:22:28 CET 2011



On Tue, 25 Jan 2011, Bo Berglund wrote:

> On Tue, 25 Jan 2011 00:04:27 +0100, "Dipl. Phys. Jörg Schläger"
> <js at jsdevelop.de> wrote:
>
>> 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
>
> Can you please specify which ODBC database components you used in
> Delphi 7??
> For example what is the type of Query1?
> And if it needs a database connection component to work, what is that?

You can use TDatabase and TQuery. 
In that case, you must configure the ODBC connection in the BDE.

Michael.


More information about the Lazarus mailing list