Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to connect to a SQL Server database without using a
Message
 
À
19/06/2002 20:19:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00670389
Message ID:
00670392
Vues:
38
This message has been marked as the solution to the initial question of the thread.
1. Define a DSN-less connection to your SQL Server database.
Below is a sample to connecto to SQL Server's Northwind
database.

	OPEN DATA YourDBC
	CREATE CONNECTION MyConnection ;
	   CONNSTRING 'DRIVER=sql server;SERVER=(local);UID=sa;PWD=;DATABASE=northwind'
	
2. Create your remote view to use this connection.

	CREATE SQL VIEW MyView REMOTE CONNECTION MyConnection SHARE AS ;
	    select EmployeeID, LastName, FirstName from employees
	
3. Use your remote view as a regular VFP table.

	OPEN DATA YourDBC
	USE MyView
	BROWSE
	
or, you could use SQL pass-through with something like:
nConn = SQLStringConnect('DRIVER=sql server;SERVER=(local);UID=sa;PWD=;DATABASE=northwind')
sqlexec(nConn, 'select * from employees', 'curEmployees')
select curEmployees
browse
>Hi friends!
>
>I want to know how to connect to a SQL Server database without using a DSN. I mean, how to connect using a connection string. I don't know all the parameters needed to connect properly. This would be very helpful to me.
>
>TIA
>
>Renzo
>
>renzovela@yahoo.com
Hector Correa
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform