Hello,
Our application is using Delphi 6 & MS SQL Server 2005. I connect to the database using ODBC. I need to display the SQL Server and the database name on one of the forms. I tried this query, "SELECT @@SERVERNAME SEVERNAME, db_name() DBNAME", using a TQuery component. The query opens fine and BOF <> EOF is true after opening the query. However, when I try to read Fields[0].AsString, it doesn't have any fields.
Please let me know if I can do this through TQuery. If not, what other ways I can use to get the SQL Server name and its database name.
Thanks,
Raj
Our application is using Delphi 6 & MS SQL Server 2005. I connect to the database using ODBC. I need to display the SQL Server and the database name on one of the forms. I tried this query, "SELECT @@SERVERNAME SEVERNAME, db_name() DBNAME", using a TQuery component. The query opens fine and BOF <> EOF is true after opening the query. However, when I try to read Fields[0].AsString, it doesn't have any fields.
Please let me know if I can do this through TQuery. If not, what other ways I can use to get the SQL Server name and its database name.
Thanks,
Raj