Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting information of SQL Tables
Message
 
À
01/05/2001 17:19:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00500421
Message ID:
00502286
Vues:
24
Here is a small sample on how to use SQLDMO:
* Connect to SQL SERVER
local oSqlserver 
oSqlserver = newobject('sqldmo.sqlserver')
oSqlServer.Connect( '(local)', 'sa', '' )

* Get a pointer to Northwind database.
local i, oNorthwind
oNorthwind = null
for i=1 to oSqlserver.Databases.Count

	if lower( oSqlserver.Databases.Item(i).name ) = 'northwind' 
		oNorthwind = oSqlserver.Databases.Item(i)
	endif

next

* Display some data about Northwind.
if not isnull( oNorthwind )

	? 'Tables in Northwind:', oNorthwind.Tables.Count
	? 'First table is:', oNorthwind.Tables.Item(1).Name
	? 'First table has ', oNorthwind.Tables.Item(1).Columns.Count, 'fields'	

endif
You can find more information about it on MSDN and on SQL Server Books Online. Infortunately, most of the samples will be on VB so you will need to figure out somethings no explicitly shown in the samples.

If you have VFP7 installed, Intellisense will make your life much easier.


>Hey, Hector, I liked that. :-)
>
>Could you give some sample or where I could find more information about that?
Hector Correa
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform