Reputation: 419
In SQL server 2008 Management studio I can do this
Use [C:\test\somedb...]
When I use Delphi 2009 with the same command, using ADO, the [] seems to be interpreted as a parameter and the command fails with parameter improperly defined error. There is no parameter - I just need to use the [] because of the \ in the file name. Double quotes don't work either in Delphi / ADO or Management Studio.
Thanks in advance...
Upvotes: 1
Views: 1510
Reputation: 125661
With ADO, you don't typically USE
in the SQL. You specify the database and the other information (driver, etc.) in the ConnectionString
. It works in SSMS because that's not using ADO; SSMS uses the SQL Server client directly (which has different requirements than ADO).
You can find connection string information for your specific SQL Server version here.
Upvotes: 1