Sc_connection_edit not updated

Hi everyone ,

My app (a blank one) uses a connection C1 (set via SQL properties) and a connection C2.
I use C2 to lookup some data in onexecute. C2 has a default settings but needs to be edited, depending on a get parameters.

It seems impossible to edit C2 and use it. It always goes to the default settings the first load. only if i reload the page it will pick up the edited connection settings.

Is there any way to edit the connection and use it in one go?

i use the app as a restfull service called directly from outside so it must be in one go and without sc_redir.

I appreciate any help, I really stuck on this one.

I start to realise that we cannot edit a connection and use it in one load.
when we reload app some “magic” happens.

I am investigating an alternative to create a new connection and use it in one load. such examples are on SC site. Nevertheless this approach requires a driver parameter. I am using SQL Server and i see in the connection, it uses a driver called DBLIB.
This driver is not listed on the list of drivers for the macro sc_connection_new.
Any suggestions welcome on how to create a new connection using sc_connection_new for sql server .

Since it’s a restfull service and hasn’t any interface, why don’t you use directly ad adodb objet, make the connection and execute the commands you need ?

1 Like

Was thinking of it as a plan B. Thank you.
I try to use SC as much as possible and avoid custom code which needs to be maintained .
In this case it seems impossible , indeed. Macro sc_connection_edit does just sets a session variables . The real change in the connection happens before the app init event, which is an min point. I would appreciate a connection init event or a function to trigger it.

For now , i will go on with a php coded connection, as you suggest.

1 Like