Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Como accesar una tabla de VFP por OLDB
Message
De
24/05/2005 18:31:16
 
 
À
24/05/2005 15:35:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Network:
SAMBA Server
Database:
Visual FoxPro
Divers
Thread ID:
01017119
Message ID:
01017315
Vues:
24
>Alex avusare, como hago para crear apartir de un Recorset una tabla.
>
>por ejemplo si hago una consulta a una tabla de articulos el resultado va a ser X o Y, Puedo yo crear una tabla a partir de esa estructura?
>
>no se si me explico.


Has leido los links que te indiqué?
Aqui tienes otro:
http://www.portalfox.com/modules.php?op=modload&name=News&file=article&sid=407&mode=nested&order=0&thold=0

Hay alli ejemplos de uso (incluyendo uno mio en http://fox.wikis.com/wc.dll?Wiki~VFPOleDBProvider)

Aqui tienes uno accediendo a MS_Access:
* OleDB y ADO a BD Nortwhind en Access

#Define adUseClient   3
#Define adLockBatchOptimistic   4
#Define adCmdTable   2

oConnection = CreateObject("ADODB.Connection")

*-- Abrir la conexión por medio de una cadena
oConnection.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\temp\northwind.mdb;")

*-- extraer datos
oRecordSet = CreateObject("adodb.recordset")
*oRecordSet.Open("Select * From Customers",oConnection)

With oRecordset
   .ActiveConnection = oConnection
   .Source = "Select * From Customers"
   .CursorLocation = adUseClient
   .Open
EndWith

CREATE TABLE Customers FREE (CustID C(10), cName C(40) NULL)

oRecordSet.MoveFirst
DO WHILE NOT oRecordSet.EOF
  INSERT INTO Customers (CustID, cName) ;
  	VALUES (oRecordSet.Fields("CustomerID").Value, oRecordSet.Fields("CompanyName").Value)
	oRecordSet.MoveNext
ENDDO

oRecordSet.Close
oConnection.Close

GO TOP
BROWSE


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform