문제

I try to get the version of an ASE Sybase version, using Delphi 2009 and dbExpress

My code is

with SQLQuery1 do
  begin
    SQL.Text := 'select @@version';
    Open;
    Memo1.Lines.Add(FieldList.Fields[0].Value);
    Close;
  end;

The Open statement raises an exception with message "SQLQuery1: field name missing". What intrigues me is tha t with ADO, the same code works quite well and i get sommething like this:

Adaptive Server Enterprise/15.7.0/EBF 21204 SMP SP50 /P/X64/Windows Server/ase157sp5x/3286/64- bit/OPT/Thu Jul 11 16:47:22 2013

I also get the same error with this query

SQL.Text := 'select count(*) from myDB..sysobjects where name = ''db_vers'''
도움이 되었습니까?

해결책

Try to add an alias as below

select @@version as version

It should work also for second query.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top