Alguns cuidados ao integrar aplicações mediator com outras que acessam o mesmo banco.
Desculpem-me por não traduzir.
E tbm quero aproveitar para parabenizar a todos do forum. Mto bom.
Retirado do Doc que vem com o Mediator.
Integrating an application with other
SQL applications
Applications created with SQL tools (for example Designer/Developer 2000, Delphi,
Power Builder and others) can read data from the Mediator tables created with the
MEDNTX (MEDCDX) driver. Such tables can be modified if certain security
measures are taken. When creating the SQL application, the following guidelines
need to be followed:
• updating contents of recno and is_deleted fields
• updating expression indexes correctly (ie$0, ie$1 ...)
• record locks placed by the XBASE application using RLOCK() function outside
a transaction will not be visible in SQL applications
• table locks placed by XBASE applications using FLOCK() function will not be
visible in SQL applications
If you need to modify Mediator-managed tables from GUI applications running in
Windows environment (other then Harbour or xHarbour ones) the most convenient
and safe method is to deploy OLEDB driver for Mediator. This driver allows you to
access Mediator tables via ADO database API. ADO/OLEDB driver for Mediator
automatically maintains all required additional columns in Mediator tables and
ensures correct cooperation of Mediator and ADO locks.
Mas vs podem usar: USE <Query> AS "<comando select>" (Na página VI-83, do Pdf que acompanha o pacote Mediator, está bem detalhado o uso de USE AS).
É possivel usar qlqer tabela, mesmo as que não foram criadas com a estrutura do mediator. Mas desse modo não é possÃvel usar alguns comandos e funções, ex.: replace with(a Query assume o formato de uma tabela, mas temporaria, e pode ser salva em disco), então pra atualizar, deletar e inserir registros pode ser usada a função MedExecSql(comando sql), esta só não aceita selects.
Flws