Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ODBC connection from SQL 2008
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01510684
Message ID:
01510707
Views:
58
>Thanks Boris
>
>Can you point me to some example code for code for connecting to the SQL server from a machine logged onto the domain please?
>
>!st requirement is just to browse the data in a table
>
>2nd requirement is to append/amend/delete records in a table
>
>Many thanks
>
>Rob
**** If you use SQL Server Authentication
TEXT TO ConnectionString NOSHOW PRETEXT 15
     DRIVER={SQL Server Native Client 10.0};Database=YourDataBase;UID=username;PWD=password;
ENDTEXT

**** If you use Trusted connection
TEXT TO ConnectionString NOSHOW PRETEXT 15
     DRIVER={SQL Server Native Client 10.0};Database=YourDataBase;Trusted_Connection=yes;
ENDTEXT


lnHandler = SQLSTRINGCONNECT(ConnectionString)
IF lnHandler < 0
   AERROR(laError)
   MessageBox(laError[1,2])
ENDIF
You could force the ODBC to use some protocol with adding this to connection string:
Network=dbnmpntw -> Named pipes
Network=dbmssocn -> TCP/IP
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Reply
Map
View

Click here to load this message in the networking platform