Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Trying to open local SQL Server database
Message
From
16/01/2006 04:35:38
 
 
To
16/01/2006 03:05:10
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01087065
Message ID:
01087074
Views:
14
>I am trying to open a local SQL Server database. From the VS 2005 interface, the connection string gives this:
>
>
>Data Source=.\SQLEXPRESS;AttachDbFilename="D:\Visual Studio Projects\Test\Test.mdf";Integrated Security=True;User Instance=True
>
>
>So, from VFP, I do this:
>
>
>lcSQLString=[Data Source=.\SQLEXPRESS;AttachDbFilename="D:\Visual Studio Projects\Test\Test.mdf";Integrated Security=True;User Instance=True]
>lnSqlHandle = SQLSTRINGCONNECT(lcSQLString)
>
>
>But, as soon as I execute the SQLSTRINGCONNECT line, I have this Select Data Source window which is appearing. How can I succeed to open this connection?


Michel,
AFAIK .NET use its own connection string when you use SqlConnection that is different then usual Connection strings.

Try with:
lcSQLString=[Driver={SQL Server};Server=MyServerName/SQLEXPRESS;Database=Test;Trusted_Connection=yes;]
lnSqlHandle = SQLSTRINGCONNECT(lcSQLString)
Something like this. Not tested
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform