Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to block Excel from openning my tables?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00650986
Message ID:
00650991
Views:
19
>I've been told it is possible to block people from openning my tables using excel. Does anyone know how to do this using VFP7?
>
>Thank you,
>Bryan Smith
>
>PS: Does it have something to do with database container procedures?

Yes, enable DBC events in your DBC. Open the database, then edit the properties of the database and check the box that say Enable DBC Events, or issue:

DBSetProp('MyDBC','Database','DBCEvents',.T.)

Edit the Stored Procs in the DBC, and add the following method [from VFP Help:
PROCEDURE dbc_BeforeOpenTable(cTableName)
* Just before a table or view is opened. 
* Return .F. to prevent table or view being opened.
   if version(2) <> 2 AND vartype(goApp) <> "O"
      return .f.
   endif
ENDPROC
When you launch your app, make sure you create an object called goApp. Excel and any other software will now not be able to open tables. I added the VERSION(2) to the IF so you can open tables at design time withoug having to create the goApp object.
Mark McCasland
Midlothian, TX USA
Previous
Reply
Map
View

Click here to load this message in the networking platform