Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Manually Open a View in a private DataSession
Message
De
12/03/2012 08:57:36
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Manually Open a View in a private DataSession
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
MySQL
Application:
Desktop
Divers
Thread ID:
01538035
Message ID:
01538035
Vues:
75
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
Fil
Voir

Click here to load this message in the networking platform