PC SOFT

PROFESSIONAL NEWSGROUPS
WINDEVWEBDEV and WINDEV Mobile

Home → WEBDEV 2024 → Cannot add multiple identical databases to analysis
Cannot add multiple identical databases to analysis
Started by Stef, Jan., 24 2013 10:23 AM - 9 replies
Registered member
45 messages
Posted on January, 24 2013 - 10:23 AM
Hi,

Working with Windev 17.
I need to add multiple structurally identical MySql databases to the analysis of my project. I want to determine which database a certain user will be connected to at login time using an ini file, which on itself works fine.

When adding various databases those databases appear as subfolders within the analysis. However as I found out yesterday these folders have no functional use for the Winpro program itself, they serve merely a visual purpose to group data files logically for the developer.
It seems there is no way to make the analysis accept 2 or more data files with identical names but residing in different databases.

Does anyone know of a solution or workaround to this issue. Renaming the tables per database is no option.

Thx
Registered member
45 messages
Posted on January, 24 2013 - 10:42 AM
By the way, each database is adressed via a seperate connection, in case some of you might be wondering whether this might be the cause. Which it isn't.
Posted on January, 24 2013 - 4:04 PM
Hi Stefan

why would you want to add several sets of identical files to the analysis ?

The ONLY purpose of the analysis is to describe the STRUCTURE of the DB...

As all your DB share this structure, one description is enough...

After that, you just need to do your hchangeconnection in your project
init code and you are done

Best regards


--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

More information on http://www.fabriceharari.com

On 1/24/2013 4:05 AM, Stef wrote:
By the way, each database is adressed via a seperate connection, in case some of you might be wondering whether this might be the cause. Which it isn't.
Registered member
45 messages
Posted on January, 25 2013 - 9:50 AM
Hi Fabrice,

Thank you for your answer.
Maybe I did not explain the problem completely. The issue is that I need to connect to multiple identical database at the same time. 1 database will always need to be connected and depending on the customer another database with the same structure and table names has to be addressed. Hope this clarifies the issue.
Posted on January, 25 2013 - 3:09 PM
Hi Stefan

yes it does... What you are looking for is the instruction hAlias... As
I was saying, You do not need anything more in the analysis (same
structure), you just need to declare an alias of file and make it point
to the right place

Best regards


--
Fabrice Harari
Consultant WinDev, WebDev et WinDev Mobile International

Plus d'information sur http://fabriceharari.com/index_FR.html


On 1/25/2013 3:50 AM, Stef wrote:
Hi Fabrice,

Thank you for your answer.
Maybe I did not explain the problem completely. The issue is that I need to connect to multiple identical database at the same time. 1 database will always need to be connected and depending on the customer another database with the same structure and table names has to be addressed. Hope this clarifies the issue.
Registered member
45 messages
Posted on January, 28 2013 - 6:07 PM
Hi Fabrice,

Thanks again for your answer. I tried this function and it seems it creates an empty copy of the source table in a (thusfar seemingly random ?) connected database.
Which would then have to be filled with information from the original databasetable it represents I guess ?
And after editing, the information would have to be synchronised with the original table in the target database ?
This seems to me a rather complicated solution because we will have to keep track of record id's, handle recordlocks programmatically taking into account possible concurrent users at multiple locations ....
As I see it, we would need to duplicate a part of the relational logic that is already embedded in the SQL database, which sounds to me a bit like re-inventing the wheel ?

Would using this function in combination with HCreateMovableReplica be a good idea ?

Thanks again
Stefan
Posted on January, 28 2013 - 11:36 PM
Hi Stefan

it seems we are not talking about the same thing...

I though you wanted to be able to access several versions of the same DB
at the same time.. In which case, halias is a way of saying:
- I have a description MyFileA
- by default the decription MyFileA applys to the file in directory (hf
calssic) or DB (other type of DB) X
- I want to acces the same desciption in DB Y, I use halias to say:
"apply description MyFileA to DB/Connection Y"

After that, what you want to do with the 2 DB at the same time is a
completely different problem, and was not, AFAIK, part of your original
question

Best regards


--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

More information on http://www.fabriceharari.com


On 1/28/2013 11:35 AM, Stef wrote:
Hi Fabrice,

Thanks again for your answer. I tried this function and it seems it creates an empty copy of the source table in a (thusfar seemingly random ?) connected database.
Which would then have to be filled with information from the original databasetable it represents I guess ?
And after editing, the information would have to be synchronised with the original table in the target database ?
This seems to me a rather complicated solution because we will have to keep track of record id's, handle recordlocks programmatically taking into account possible concurrent users at multiple locations ....
As I see it, we would need to duplicate a part of the relational logic that is already embedded in the SQL database, which sounds to me a bit like re-inventing the wheel ?

Would using this function in combination with HCreateMovableReplica be a good idea ?

Thanks again
Stefan
Registered member
45 messages
Posted on February, 01 2013 - 1:15 PM
Hi Fabrice,

But we are talking about exactly the same thing !
Your summary is 100 % correct.
I just can't figure out how the HAlias function is supposed to work. It creates an empty table in a seemingly random connected database ? A table that cannot be queried as far as I can see but surely I am missing out on something here ?

Fabrice Harari wrote in news message <5106d4db@news.pcsoft.fr>:
Hi Stefan

it seems we are not talking about the same thing...

I though you wanted to be able to access several versions of the same DB
at the same time.. In which case, halias is a way of saying:
- I have a description MyFileA
- by default the decription MyFileA applys to the file in directory (hf
calssic) or DB (other type of DB) X
- I want to acces the same desciption in DB Y, I use halias to say:
"apply description MyFileA to DB/Connection Y"

After that, what you want to do with the 2 DB at the same time is a
completely different problem, and was not, AFAIK, part of your original
question

Best regards


--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

More information on http://www.fabriceharari.com


On 1/28/2013 11:35 AM, Stef wrote:
Hi Fabrice,

Thanks again for your answer. I tried this function and it seems it creates an empty copy of the source table in a (thusfar seemingly random ?) connected database.
Which would then have to be filled with information from the original databasetable it represents I guess ?
And after editing, the information would have to be synchronised with the original table in the target database ?
This seems to me a rather complicated solution because we will have to keep track of record id's, handle recordlocks programmatically taking into account possible concurrent users at multiple locations ....
As I see it, we would need to duplicate a part of the relational logic that is already embedded in the SQL database, which sounds to me a bit like re-inventing the wheel ?

Would using this function in combination with HCreateMovableReplica be a good idea ?

Thanks again
Stefan
Posted on February, 01 2013 - 2:49 PM
Hi Stef

Halias is creating a new/second NAME for the same table... If you just
do the halias, the second name points onto the same file as the first
one, allowing you to have two different cursors on the same physical
file (at some point in time, it was the only way to achieve that).

But once you do have a second name, you can use all the other hxxxx
functions on it, including the hchangeconnexion that will allow you to
point your second name to a DIFFERENT physical file... Once you have
done that, you have YourFileName pointing to file of description A in DB
X, while YourAliasOfFileName is pointing to file of description A in DB Y

Best regards

--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

More information on http://www.fabriceharari.com


On 2/1/2013 6:27 AM, Stef wrote:
Hi Fabrice,

But we are talking about exactly the same thing !
Your summary is 100 % correct.
I just can't figure out how the HAlias function is supposed to work. It creates an empty table in a seemingly random connected database ? A table that cannot be queried as far as I can see but surely I am missing out on something here ?

Fabrice Harari wrote in news message <5106d4db@news.pcsoft.fr>:
Hi Stefan

it seems we are not talking about the same thing...

I though you wanted to be able to access several versions of the same DB
at the same time.. In which case, halias is a way of saying:
- I have a description MyFileA
- by default the decription MyFileA applys to the file in directory (hf
calssic) or DB (other type of DB) X
- I want to acces the same desciption in DB Y, I use halias to say:
"apply description MyFileA to DB/Connection Y"

After that, what you want to do with the 2 DB at the same time is a
completely different problem, and was not, AFAIK, part of your original
question

Best regards


--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting

More information on http://www.fabriceharari.com


On 1/28/2013 11:35 AM, Stef wrote:
Hi Fabrice,

Thanks again for your answer. I tried this function and it seems it creates an empty copy of the source table in a (thusfar seemingly random ?) connected database.
Which would then have to be filled with information from the original databasetable it represents I guess ?
And after editing, the information would have to be synchronised with the original table in the target database ?
This seems to me a rather complicated solution because we will have to keep track of record id's, handle recordlocks programmatically taking into account possible concurrent users at multiple locations ....
As I see it, we would need to duplicate a part of the relational logic that is already embedded in the SQL database, which sounds to me a bit like re-inventing the wheel ?

Would using this function in combination with HCreateMovableReplica be a good idea ?

Thanks again
Stefan

Registered member
45 messages
Posted on February, 01 2013 - 4:25 PM
This does clarify things a lot, thank you !