For database connection questions, ask Delphi/Windows SDK/API
Http://www.delphi2007.net/DelphiDB/html/delphi_20061225170249110.html
Use DBE to establish a database connection to the server MSSQL. Use tTable, TDBGrid, and tdatasource to connect to a table. Program Can only be run locally?
The EXE file generated after compilation cannot be run on another computer. Do you need to set this on each computer?
Is it possible for Delphi to generate an EXE without additional settings and put the EXE file on any computer to access the database?
This is hard to say. I only use three controls: adodataset, datasource, and DBGrid.
Adodataset1.connectionstring: = 'provider = sqloledb.1; persist Security info = false; user id = sa; Password = 123456; initial catalog = gongda; Data Source = xinx ';
Performance1.dataset: = adodataset1;
Sqlstring: = 'select * From cjyg where username is not null ';
Adodataset1.commandtext: = sqlstring;
Dbgrid1.datasource: = performance1;
Dbnavigator1.datasource: = performance1;
Adodataset1.active: = true;
A simple program can directly generate *. EXE, but if you use some files, you need additional settings, such:
Uses qdialogs, you need to have qtintf70.dll in the system directory.
Now we use ADO.
The EXE file generated after compilation cannot be run on another computer. Do you need to set this on each computer?
========================================================== ========================================================== =
If you use BDE, you must install and configure BDE on the machine where each program runs. Of course, if three layers are used, you can only configure the computer where the application server is located. Other computers do not have to be configured.
Which of the following can I use adoconnection and adotable to display the data table?
What if you only want to select a sub-segment, instead of displaying the entire table?
Adoconnection, adodataset (you can set SQL statements), datasource, TDBGrid. The use of the latter two is the same as that of BDE.