Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ADO/ADOX and Access tables
Message
 
To
29/04/2002 04:08:24
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00650178
Message ID:
00650381
Views:
18
To complete the picture I'd like to add two another approaches:

Using ADOX:
oCat = CreateObject("ADOX.catalog")

oCat.ActiveConnection = "DRIVER={Microsoft Access Driver (*.mdb)};" +;
                 "Dbq=d:\Program Files\Microsoft Visual Studio\VB98\NWind.mdb;" +;
                 "Uid=Admin;" +;
                 "Pwd=;"
lExist = .T.
On Error lExist = .F.
oCat.Tables('customers').Type
On Error
?lExist
Using OLEDB library (file #10002):
oConn = CreateObject("OLEDBFox.Connection")

oConn.StringOpen("DRIVER={Microsoft Access Driver (*.mdb)};" +;
                 "Dbq=d:\Program Files\Microsoft Visual Studio\VB98\NWind.mdb;" +;
                 "Uid=Admin;" +;
                 "Pwd=;")
oConn.Tables()
LOCATE FOR UPPER(table_name)="CUSTOMERS"
? FOUND()
>
>>What is the best way to test for existence of a table in a Access database?
Previous
Reply
Map
View

Click here to load this message in the networking platform