TSQLConnection to SQL Server file

Posted on 2005-04-27
Medium Priority
Last Modified: 2008-02-01
Hey all

just wondering with the dbexpress component TSQLConnection what parameters do i need if i want to connect to directly to a SQL Server .MDF File.

currently i just work on registered databases with the paramters

Database (which is just the name of a registered database)

but want to work on unregistered databases with just their data file

any ideas?
Question by:ex_02
LVL 22

Accepted Solution

JesterToo earned 1840 total points
ID: 13883219
I don't believe it's possible to "connect directly to a SQL Server .MDF file"... while SQL Server has the database running it owns all access to the mdf/ldf files... otherwise, there would be no way to ensure the integrity of the data.

The DbExpress TSQLConnection is merely an alternative access mechanism like ADO.  It communicates with the DBMS engine which performs all the accesses to the actual data.

Author Comment

ID: 13883277
What if the MDF file is not registered with SQL Server can you connect to the file then?

LVL 23

Expert Comment

ID: 13884262
To be able to exploit an MDF file you need at least a DBEngine that can interpretate its structure.  In that sense the DB Engine is a necessary API for exploiting and making sense of the data stored in the file.  Hope this helped...


Expert Comment

ID: 13890788
so its just a sql sever specific? cause with interbase i can open a file no worries just askes for a .gdb was hoping sql server would be the same :)

but its obviously not ??
LVL 22

Expert Comment

ID: 13890929
I'm not familiar with Interbase but I have a great deal of experience with MS SQL Server and other RDBMS's... all of them that I know about work as I described above.

-- Lynn

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Creating a Cordova application which allow user to save to/load from his Dropbox account the application database.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
Suggested Courses

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question