I'm trying to access into a database in SQL Server 2019 Express from my old Delphi 7 project that still using BDE and SQL Server as Driver name (for migration only). With the db1 (tDatabase
) setting like this:
DATABASE NAME=master
USER NAME=sa
ODBC DSN=base6280 *// (that I've created first)*
OPEN MODE=READ/WRITE
PASSWORD=abc
But after connecting to MASTER
database, when I ran this query (tQuery
):
cbDBname.Items.Clear;
Q := TQuery.Create(nil);
try
Q.DataBaseName := 'MASTER';
Q.SQL.Text := ' SELECT NAME as DBxxx
FROM MASTER.DBO.SYSDATABASES
ORDER BY Name DESC ';
Q.Open;
while not Q.Eof do
begin
cbDBname.Items.Add(Q.FieldByName('DBxxx').AsString);
Q.Next;
end;
I get an error :
Can somebody here help me to figure out? How to handle this error?
Thanks for your attention and any response (beside bde has been depreciated) is much more expected.