Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting Records out of Access Tables
Message
From
03/11/2004 06:24:06
 
 
To
02/11/2004 17:24:08
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00954660
Message ID:
00957501
Views:
18
hi,

i try to convert access table as under i use your code,
i get at my screen
"C:\DB2\TEST1_MDB\"
"C:\BILLS\TEST123_DBF\"

but no tables test123 at bills.DIR

maybe your code mean somthing else.
lcImportFromDir = "C:\DB2\TEST1_MDB\"
lcExportToDir = "C:\BILLS\TEST123_DBF\"

lcOpenMDB = (SYS(2000,(lcImportFromDir + ("*.mdb"))))
DO WHILE ! EMPTY(lcOpenMDB )
	lcExportTableName = LEFTC(lcOpenMDB,(AT(".",lcOpenMDB)-1))
	lnConnHandle = SQLSTRINGCONNECT('DSN=MS Access Database;DBQ=' + lcImportFromDir + lcOpenMDB + '; DefaultDir=' + lcImportFromDir + ';DriverId=25;FIL=MS Access; MaxBufferSize=2048; PageTimeout=5; UID=admin;')
	SQLTABLES(lnConnHandle, ['TABLE'], 'ThisMDB')
	SELECT ThisMDB
	SCAN
	  lcSQL = 'SELECT * FROM "' + ALLTRIM(table_name) + '"'
	  lcCursor = ALLTRIM(table_name)
	  lcTableName = LEFTC(lcOpenMDB,(AT(".",lcOpenMDB)-1)) + '^' + lcCursor
	  SQLEXEC(lnConnHandle,lcSQL,lcCursor)
	  SELECT (lcCursor)
	  COPY TO (lcExportToDir + lcTableName)
	  USE IN (lcCursor)
	 
	ENDSCAN
	USE IN ThisMDB
	SQLDISCONNECT(lnConnHandle)
	lcOpenMDB = (SYS(2000,(lcImportFromDir + ("*.mdb")),1))
ENDDO
thanks.
m.qasem
Previous
Reply
Map
View

Click here to load this message in the networking platform