Information générale
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Manually Open a View in a private DataSession
Versions des environnements
I am trying to open a view in a private datasession to check if a record exist on the database server. If it does not I want to insert a record.
The database server will not always be available. If it is not I want to go ahead and open the form with the vfp tables that are in it.
There are no controls tied to the view.
I am not sure how to trap if the database server is not available. If I have it to open automatically in the dataenviroment. I get the mysql error "can not connect" and then the form is closed. I have not been able to trap this and go ahead and open the rest of the tables.
So I thought I would manually open the view and if there was an error cancel opening the view. I took the view out of the data environment and in the click event of a button used the following code. "Use myview in 0". This works if the forms datasession is set to default.
If it is set to private then I get an error saying "File C:\mbc5\.dbc does not exist.". The form then closes. The mbc5.dbc that the view is in is actually in a directory mapped to M. The vfp dbf tables that are in the dbc are open and showing when I try this statement.
What am I doing wrong?
Randy
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement