New macros and example released

Hello there guys,

We just release a new Scriptcase macro that you guys aways asked us to do, we implemented a macro to change the connection data (such as, host, drive, user, password, enconding, …) dynamically, so now you can do it via code, not only change the info from the connection but you can also create a new one from scratch.

Check the new example and its tutorial

http://www.scriptcase.net/scriptcase-samples/php-systems/multiple-connections/

http://www.scriptcase.net/scriptcase-samples/tutoriais/systems/multiple_databases.php

Enjoy

Please change sc_connection_new() parameter “drive” to “driver” … “Drive” is not the correct expression for that!

Thanks Carlos, but sample don’t works.

Hello guys,

Thanks for your feedback. I will discuss it with our team.

regards,
Bernhard

I asked then before and I was told that “drive” is the correct syntax for that.

Buddie,

It is working here, Could you be more specific? Thanks.

[QUOTE=carlos;28002]Buddie,

It is working here, Could you be more specific? Thanks.[/QUOTE]

http://www.scriptcase.net/scriptcase-samples/php-systems/multiple-connections/ just gives me a blank page

No, you would set a “driver” to access the databases, but not “drive” a driver to access …

The main thing is, it works … but the little things are important.

[QUOTE=RHS;28014]No, you would set a “driver” to access the databases, but not “drive” a driver to access …

The main thing is, it works … but the little things are important.[/QUOTE]

Agreed. The correct term is “driver”.

We invented this stuff. We know the terminology.

“Drive” is either a noun or a verb, depending on context. As a noun, “Drive” would usually mean a disk drive (a flat box that stores data), or as a verb it would likely mean “pilot a car”.

“Driver” is a noun that refers to a software interface between two objects, either hardware or software.

And, THANK YOU!

Now, we can use ScriptCase for very large projects.

P L E A S E, use the correct term(s) (see above):

sc_drive.jpg

Caution: If anyone is planning on trying this - read thread: http://www.scriptcase.net/forum/showthread.php?7258-sc_connection_edit-does-not-work-in-prod-mode

Good idea, but I hope it is fixed before ScriptCase 9

Dave

[QUOTE=RHS;28489]P L E A S E, use the correct term(s) (see above):

[/QUOTE]

Hello Reinhard,

I will verify this issue.

regards,
Bernhard Bernsmann

Well, this was supposed to be fixed in 8.00.0015 today, but no luck.

It no longer generates a function-not-found error, but it simply does not work the same in production as in developer mode.

If anybody at NetMake needs a sample app that demonstrates this, I have one and would be happy to forward it.

The symptoms are simple to reproduce.

  1. Create a database with one table, containing one column. Call this database “demo-1”.
  2. Create another database like demo-1 and call it demo-2. Use same username, password, table name, column name. Only the database name is different.
  3. Add easily recognizable data to the two tables so that you can tell the two databases apart by their contents.
  4. Create a grid using one of the databases, call it my_grid
  5. Create two blank apps, blank_a and blank b with the following contents:

blank_a:

sc_connection_edit(“conn_mysql”, array( ‘database’ => ‘demo-1’));
sc_redir(‘my_grid’);

blank_b:

sc_connection_edit(“conn_mysql”, array( ‘database’ => ‘demo-2’));
sc_redir(‘my_grid’);

  1. Create a menu app with two menu items, linking to the two blank apps.

When you run this in Developer Mode, it behaves exactly as I would expect, selecting a menu item changes the data that gets displayed.

When you run this from Production Mode, the data never changes. It acts like the grid is never re-opening the connection using the new connection info.

My belief is that in production mode, the grid uses the connection data that it already has in place, instead of init() noticing that the connection data has changed.

By the way, your own sample from the link at the beginning of this thread is doing exactly the same thing. THe charts for the two companies are THE SAME, not coming from different databases at all.

Dave

Carlos,

Company B customer grid returns the same data as Company A.

Dave