Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Attaching to a SQL Database
Message
From
25/02/2008 02:52:29
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01295993
Message ID:
01295996
Views:
10
>Hi.
>I have following commands:
>strConn = "Driver=SQL Server;Server=GERARDXP\SQLEXPRESS;" +;
> "Database=C:\MYFOLDER\MYDATABASE.MDF;Trusted_connection=yes"
>lnHandle = SQLSTRINGCONNECT(strConn)
>
>I get a -1 returned in lnHandle , but I can browse the table fine in SQL management Studio.

For general help on connection strings you can view http://connectionstrings.com/

My first guess would be that you don't need to specify a path for the database's .MDF file, just its database name.
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