how to drop database correctly with sdac ?

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
[email protected]
Posts: 5
Joined: Tue 11 Mar 2014 17:33

how to drop database correctly with sdac ?

Post by [email protected] » Sat 26 Oct 2019 13:03

Hello,
with ADO I can do this:
.
//some work with database "test" connected here and then I can do this
adocon.Execute('use master');
adocon.Execute('drop database test');
//database test dropped correctly

with sdac:
//some work with database "test" here and then
sdaccon.ExecSQL('use master');
sdaccon.ExecSQL('drop database test');<--- exception here :"cannot drop database test because database in use..."
//of course database test is not connected with other connection.
// how to drop database with sdac here ?
- i tried disconnect and then connect before, but without succes:
- I tried set property sdaccon.multipleconnection to false, without success

I'm sorry for maybe stupid questions, just getting started with sdac,

thank you.

[email protected]
Posts: 5
Joined: Tue 11 Mar 2014 17:33

Re: how to drop database correctly with sdac ?

Post by [email protected] » Sat 26 Oct 2019 17:36

I found a problem, i apologize to sdac, problem causes ADO, if property adoconnection.keepconnection is set to true, then adoconnection holds database for many seconds after call adoconnection.close. the problem was due to testing ADO+SDAC within one program. So it It's my fault. sorry..

Stellar
Devart Team
Posts: 496
Joined: Tue 03 Oct 2017 11:00

Re: how to drop database correctly with sdac ?

Post by Stellar » Mon 28 Oct 2019 10:52

Glad to see that the issue was resolved.
Feel free to contact us if you have any further questions about our products.

Post Reply