Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with same connection name different dbc
Message
De
23/10/2008 15:23:58
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Titre:
Problem with same connection name different dbc
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01356698
Message ID:
01356698
Vues:
57
I am working with Accountmate's VAM SQL accounting software. It uses remote views. It supports multiple companies with a separate sql server database and a separate dbc for each company as well. In each company database there is one connection object called vam connect.

Normally you have one database, both sql and vfp as the open database. the connection object vamconnect stores the database to work with.

But the problem Is that I want to be setup such that I have 'chosen' company a - database a, but besides operating on database a, I also need to perform operations against company b, database b

in the before open tables code for a form in VAM, you have statements like this:

this.curicitem.database = ocompany.cdatabase
where ocompany.cdatabase stores the full path to the dbc for the company you have selected.
and curicitem is the cursor name for a remote view

so when you open table/remote view it uses the dbc, it opens the correct company dbc
the view is created with the clause 'remote connection vamconnect'. so ?DBGETPROP('icitem','view','connectname') returns vamconnect.

but, the problem I am having, I think, is that, I think, it will look for vamconnect in the CURRENT database. so when I am 'in' company a, company a is the current database. but I want to get data from, for example, the view icitem, but in one case I want to get the data from company a (the current company) but I also want to get data from the icitem view, opened again with a different alias, looking at the data for company b. if I open the view I want it to get data from dbc b, sql server database b, it looks at the vamconnect connection in the current database.

there are HUNDREDS of views all created with the connection name vamconnect.
?CURSORSETPROP("connectname","b!vamconnect","icitem_2") tells me that the property is read only, and besides I think you can only reference the connection name without referencing the database name that it is in.

how can I tell vfp that I want the view to look at company b's data?

thanks



]
Répondre
Fil
Voir

Click here to load this message in the networking platform