Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Retrieving data from MS Access mdb files
Message
 
To
11/11/2005 16:13:09
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01067922
Message ID:
01067939
Views:
24
Dennis,
You can't SELECT from Access DB you must SELECT from ACCESS Table.
If you know what tables have this DataBase you can do:
sqlselect = "SELECT *  FROM TheTableThatIsInAccessMYTABLEMDB"
IF SQLEXEC(sqlHandler,sqlselect,"myCURSOR") <0
    MESSAGEBOX("Error - Can't Execute....")
ENDIF
If you didn't know the table names in the Access MDB
you cat try (after the connection):
SQLTABLES(sqlHandler,"TABLE","crsAcessTables") 
SELECT crsAcessTables
DIMENSION laCursors[1]
LOCAL lnCursors
lnCursors = 0
SCAN
   lcSLStatement = "SELECT * FROM["+ALLTRIM(crsAcessTables.Table_Name)+"]"
   lcCursorname = CHRTRAN(ALLTRIM(crsAcessTables.Table_Name),[ ],[_])
   lnCursors = lnCursors + 1
   DIMENSION laCursors[lnCursors]
   laCursors[lnCursors] = lcCursorname
   SQLEXEC(sqlHandler,"TABLE",lcCursorname) 
ENSCAN

FOR asd = 1 TO lnCursors
    SELECT (laCursors[asd])
    BROWSE NORMAL
NEXT
(nop error checking include, not tested)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform