Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Cursoradapter and mdb tables
Message
De
05/11/2004 10:46:19
Gaylen Miller
Leaderware Corporation
Fulton, Illinois, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Database:
Visual FoxPro
Divers
Thread ID:
00958209
Message ID:
00958509
Vues:
18
This message has been marked as a message which has helped to the initial question of the thread.
Hi Bernhart,

Not Cursoradapter but easy...
lcImportFromDir = "C:\AccountingData\"
lcOpenMDB = "Test.mdb"

*-This line creates a connection String to the Access Database
lnConnHandle = SQLSTRINGCONNECT('DSN=MS Access Database;DBQ=' + lcImportFromDir + lcOpenMDB + '; DefaultDir=' + lcImportFromDir + ';DriverId=25;FIL=MS Access; MaxBufferSize=2048; PageTimeout=5; UID=admin;')

*-You can now use 'lnConnHandle' in SQL statements to Access the mdb and do whatever you want.
*-i.e.
*-This line opens a cursor named 'ThisMDB' which contains a record for each Table in the mdb which includes the Table_Name.
SQLTABLES(lnConnHandle, ['TABLE'], 'ThisMDB')

*-The following SCAN opens for editing all tables in the mdb
SELECT ThisMDB
SCAN
 	lcCursor = ALLTRIM(table_name)
 	lcSQL = 'SELECT * FROM "' + ALLTRIM(table_name) + '"'
	lcTableName = LEFTC(lcOpenMDB,(AT(".",lcOpenMDB)-1)) + '^' + lcCursor
	SQLEXEC(lnConnHandle,lcSQL,lcCursor)
	*-Now that this table is open, edit or whatever here, or below the SCAN...
	
ENDSCAN

SQLDISCONNECT(lnConnHandle)
Thanks
Gaylen Miller
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform