Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Attaching to a SQL Database
Message
From
25/02/2008 05:47:36
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01295993
Message ID:
01295999
Views:
11
>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.
>
>Anybody any idea of whats wrong?
>Regards,
>Gerard

Gerard,
If you'd 'attach' then use AttachDbFilename attribute. ie:
strConn = "Driver={SQL Native Client};Server=.\SQLEXPRESS;" +;
    "AttachDbFileName=C:\MYFOLDER\MYDATABASE.MDF;Trusted_connection=yes"+;
    "Database=yourdatabasenamehere"
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform