Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to connect to mdf database
Message
From
27/02/2009 03:37:01
 
 
To
26/02/2009 22:34:46
Jerry Tovar
Dana Corporation Dana It
Maumee, Ohio, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01384460
Message ID:
01384471
Views:
63
>I created a SQL database via VS2005. That created a MDF file in the app_data directory.
>
>How can I create a DSN entry to this MDF database? Or how can I connect to this MDF file from VFP?

If you've created a SQL database via VS2005 (I assume in Visual Studio 2005), you attached to a (most likely) SQL Server database server, which controls access to the MDF file. You interact with the database server process, not with the file directly like you do with VFP.

You will need to know the database server name, and the name of the database you created within the server. You can then use either:

- VFP SQL pass through commands ( e.g. SQLSTRINGCONNECT( ) ), connecting to the database server and database via ODBC

- A CursorAdapter, connecting to the database server and database via OLEDB

http://connectionstrings.com/sql-server-2005

You may need to install an ODBC or OLEDB driver as required.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Reply
Map
View

Click here to load this message in the networking platform