Delphi 7: how to execute shell command and check the result?

前端 未结 6 411
一整个雨季
一整个雨季 2021-01-01 08:28

I\'m using Delphi 7 and can\'t predict the target version of Windows.

I need to create a database (probably MySql, but might be something else) and define some table

6条回答
  •  北海茫月
    2021-01-01 08:39

    I wrote a unit and set of components to handle console redirection in delphi quite a long time ago:

    http://www.fulgan.com/delphi/dospipes15.zip

    But beyond that, you shouldn't have to go through that: use the ADO connection component just to connect to the database's default catalog and then use the "execute" method to create whatever database and schema you need. The database SERVER need to be properly installed and running for this to work but, at least with MSSQL, there is no problem with creating new databases this way. the exact connection string to use might change depending on the target DB, though.

提交回复
热议问题