Questions about database connection

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.