[Gambas-user] Two Databases at the same time...
Christian e Ana Luiza Britto
chriseana at ...626...
Tue Dec 16 16:39:54 CET 2014
Thank you so much Lee,
You really help me a lot!
Best regards,
Christian
2014-12-16 8:48 GMT-02:00, gambas-user-request at lists.sourceforge.net
<gambas-user-request at lists.sourceforge.net>:
> Send Gambas-user mailing list submissions to
> gambas-user at lists.sourceforge.net
>
> To subscribe or unsubscribe via the World Wide Web, visit
> https://lists.sourceforge.net/lists/listinfo/gambas-user
> or, via email, send a message with subject or body 'help' to
> gambas-user-request at lists.sourceforge.net
>
> You can reach the person managing the list at
> gambas-user-owner at lists.sourceforge.net
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Gambas-user digest..."
>
>
> Today's Topics:
>
> 1. Re: Bug with GTK+ (Beno?t Minisini)
> 2. Re: Bug with GTK+ (Jussi Lahtinen)
> 3. Re: Bug with GTK+ (Jussi Lahtinen)
> 4. Re: Bug with GTK+ (Beno?t Minisini)
> 5. Re: Bug with GTK+ (Jussi Lahtinen)
> 6. Re: Two Databases at the same time... (T Lee Davidson)
> 7. Where are the examples? (rolf)
> 8. Re: Bug with GTK+ (Beno?t Minisini)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 16 Dec 2014 03:10:51 +0100
> From: Beno?t Minisini <gambas at ...1...>
> Subject: Re: [Gambas-user] Bug with GTK+
> To: mailing list for gambas users <gambas-user at lists.sourceforge.net>
> Message-ID: <548F94AB.5050805 at ...1...>
> Content-Type: text/plain; charset=windows-1252; format=flowed
>
> Le 14/12/2014 18:46, Jussi Lahtinen a ?crit :
>>>
>>> Disabling a control, then re-enabling it, then giving it focus back
>>> inside a keypress event is not a good idea.
>>
>>
>> The keypress event waits for enter key as sign of end of user input.
>> Then the idea is to disable user input while data is shown in other
>> control.
>> This was first thing in my mind how to do it.
>>
>>
>> Jussi
>
> But there is no need to disable the control, re-enabling it, then giving
> it focus back. What for? Just disable it when enter is hit.
>
> --
> Beno?t Minisini
>
>
>
> ------------------------------
>
> Message: 2
> Date: Tue, 16 Dec 2014 04:29:56 +0200
> From: Jussi Lahtinen <jussi.lahtinen at ...626...>
> Subject: Re: [Gambas-user] Bug with GTK+
> To: mailing list for gambas users <gambas-user at lists.sourceforge.net>
> Message-ID:
> <CAFJMe7Q3c2sWsPe5nRVQBeHhay9t3eS4GnfhzDP9Ag_CTT=5tw at ...627...>
> Content-Type: text/plain; charset=UTF-8
>
>> But there is no need to disable the control, re-enabling it, then giving
>> it focus back. What for? Just disable it when enter is hit.
>>
>
> The code you see is only isolation for demonstration of the problem. There
> is really code (call of sub) between disabling and enabling the control.
> It's not enough to just disable the control when I hit enter, because the
> program ask more input when it is done showing some data. Thus re-enabling.
> I think I added the focus because in some cases, the focus went to the
> control displaying the data (or somewhere else?).
>
>
> Jussi
>
>
> ------------------------------
>
> Message: 3
> Date: Tue, 16 Dec 2014 04:37:45 +0200
> From: Jussi Lahtinen <jussi.lahtinen at ...626...>
> Subject: Re: [Gambas-user] Bug with GTK+
> To: mailing list for gambas users <gambas-user at lists.sourceforge.net>
> Message-ID:
> <CAFJMe7TsB=gYN60Z9+388LZphp+TNbmkLjBR=MQcjP4JrcCPqA at ...627...>
> Content-Type: text/plain; charset=UTF-8
>
> This is what I mean:
>
> TextBox1.Enabled = False 'Prevent user messing while showing the data.
> ShowSomeData()
>
> TextBox1.Enabled = True 'Enable user to give new input...
> TextBox1.SetFocus() '...without need to click on the textbox.
>
>
> Jussi
>
> On Tue, Dec 16, 2014 at 4:29 AM, Jussi Lahtinen <jussi.lahtinen at ...626...>
> wrote:
>>
>>
>> But there is no need to disable the control, re-enabling it, then giving
>>> it focus back. What for? Just disable it when enter is hit.
>>>
>>
>> The code you see is only isolation for demonstration of the problem.
>> There
>> is really code (call of sub) between disabling and enabling the control.
>> It's not enough to just disable the control when I hit enter, because the
>> program ask more input when it is done showing some data. Thus
>> re-enabling.
>> I think I added the focus because in some cases, the focus went to the
>> control displaying the data (or somewhere else?).
>>
>>
>> Jussi
>>
>
>
> ------------------------------
>
> Message: 4
> Date: Tue, 16 Dec 2014 03:44:38 +0100
> From: Beno?t Minisini <gambas at ...1...>
> Subject: Re: [Gambas-user] Bug with GTK+
> To: mailing list for gambas users <gambas-user at lists.sourceforge.net>
> Message-ID: <548F9C96.3030601 at ...1...>
> Content-Type: text/plain; charset=windows-1252; format=flowed
>
> Le 16/12/2014 03:29, Jussi Lahtinen a ?crit :
>>> But there is no need to disable the control, re-enabling it, then giving
>>> it focus back. What for? Just disable it when enter is hit.
>>>
>>
>> The code you see is only isolation for demonstration of the problem.
>> There
>> is really code (call of sub) between disabling and enabling the control.
>> It's not enough to just disable the control when I hit enter, because the
>> program ask more input when it is done showing some data. Thus
>> re-enabling.
>> I think I added the focus because in some cases, the focus went to the
>> control displaying the data (or somewhere else?).
>>
>>
>> Jussi
>
> I'm not clear enough: you should not have to disable and re-enabling a
> control inside an event handler, because you are not supposed to call
> event loop (WAIT <time> instruction) inside an event handler. If you
> don't call the event loop, then disabling then re-enabling is useless.
>
> Regards,
>
> --
> Beno?t Minisini
>
>
>
> ------------------------------
>
> Message: 5
> Date: Tue, 16 Dec 2014 05:00:29 +0200
> From: Jussi Lahtinen <jussi.lahtinen at ...626...>
> Subject: Re: [Gambas-user] Bug with GTK+
> To: mailing list for gambas users <gambas-user at lists.sourceforge.net>
> Message-ID:
> <CAFJMe7RE0KpMDhbjNvpiXRsZZFWj4J1zXynshucaMfRxucXp4A at ...627...>
> Content-Type: text/plain; charset=UTF-8
>
>> I'm not clear enough: you should not have to disable and re-enabling a
>> control inside an event handler, because you are not supposed to call
>> event loop (WAIT <time> instruction) inside an event handler. If you
>> don't call the event loop, then disabling then re-enabling is useless.
>>
>
> OK, now I understand the issue... In fact the code showing the data uses
> "wait".
> And it seems to work as expected in Qt4. But I understand how it may create
> problems, while now it doesn't seem to.
> So, I could replace "wait" with "sleep" and take of the enable/disable
> code. However I like that the control goes gray when disabled... right now
> I can't figure out nice solution for this.
>
>
> Jussi
>
>
> ------------------------------
>
> Message: 6
> Date: Tue, 16 Dec 2014 02:01:01 -0500
> From: T Lee Davidson <t.lee.davidson at ...626...>
> Subject: Re: [Gambas-user] Two Databases at the same time...
> To: mailing list for gambas users <gambas-user at lists.sourceforge.net>
> Message-ID: <548FD8AD.3090303 at ...626...>
> Content-Type: text/plain; charset=windows-1252; format=flowed
>
> Hi Christian,
>
> You really should have most of what you need to figure this out for yourself
> at:
> http://gambaswiki.org/wiki/comp/gb.db/connection
> http://gambaswiki.org/wiki/comp/gb.db/connection/open
> http://gambaswiki.org/wiki/comp/gb.db/connection/exec
> http://gambaswiki.org/wiki/comp/gb.db/connection/edit
> http://gambaswiki.org/wiki/comp/gb.db/result
>
>
> Though not SQL optimized nor transaction safe, maybe this example will help
> you get started:
>
> Public Sub Main()
>
> Dim hConn1 As New Connection
> Dim hConn2 As New Connection
> Dim hResult1 As Result
>
> With hConn1
> .Type = "mysql"
> .Host = "localhost"
> .Login = "username"
> .Password = "passwd"
> .Name = "testdb1"
> End With
>
> Try hConn1.Open
> If Error Then Print "Cannot Open Database. Error = "; Error.Text
>
> With hConn2
> .Type = "mysql"
> .Host = "localhost"
> .Login = "username"
> .Password = "passwd"
> .Name = "testdb2"
> End With
>
> Try hConn2.Open
> If Error Then Print "Cannot Open Database. Error = "; Error.Text
>
> hResult1 = hConn1.Exec("select id, name from testdb1.those_records")
> For Each hResult1
> hConn2.Exec("update testdb2.these_records set this_name='" &
> hResult1!name & "' where this_id=" & hResult1!id)
> Next
>
> End
>
> You can also access the fields as a collection, ie. hResult1["id"],
> hResult1["name"]
>
>
> Lee
> __________
>
> "Artificial Intelligence is no match for natural stupidity."
>
>
> On 12/15/2014 01:10 PM, Christian e Ana Luiza Britto wrote:
>> Hi,
>> I need to work with 2 different databases at the same time, each one
>> with his own tables. So, what I have to do to setup up the "Result"
>> variables for each database? I wanna write a module that will read
>> data from one database to update the another.
>> Thanks,
>> Christian
>>
>> ------------------------------------------------------------------------------
>> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
>> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
>> with Interactivity, Sharing, Native Excel Exports, App Integration & more
>> Get technology previously reserved for billion-dollar corporations, FREE
>> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
>
>
>
> ------------------------------
>
> Message: 7
> Date: Tue, 16 Dec 2014 10:14:24 +0100
> From: rolf <rolf.frogs at ...221...>
> Subject: [Gambas-user] Where are the examples?
> To: gambas-user at lists.sourceforge.net
> Message-ID: <201412161014.26055.rolf.frogs at ...221...>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi,
>
> yesterday evening I compiled Gambas from trunk and no examples have been
> installed.
>
> Also the menue entry "open example" has gone.
>
> Working with the Software Farm makes me crazy. After an installation I do
> not
> find the program and the source code either. Where will the programs be
> installed?
>
> Many questions from
> Rolf
>
>
>
>
> ------------------------------
>
> Message: 8
> Date: Tue, 16 Dec 2014 11:48:03 +0100
> From: Beno?t Minisini <gambas at ...1...>
> Subject: Re: [Gambas-user] Bug with GTK+
> To: mailing list for gambas users <gambas-user at lists.sourceforge.net>
> Message-ID: <54900DE3.5010108 at ...1...>
> Content-Type: text/plain; charset=windows-1252; format=flowed
>
> Le 16/12/2014 04:00, Jussi Lahtinen a ?crit :
>>> I'm not clear enough: you should not have to disable and re-enabling a
>>> control inside an event handler, because you are not supposed to call
>>> event loop (WAIT <time> instruction) inside an event handler. If you
>>> don't call the event loop, then disabling then re-enabling is useless.
>>>
>>
>> OK, now I understand the issue... In fact the code showing the data uses
>> "wait".
>> And it seems to work as expected in Qt4. But I understand how it may
>> create
>> problems, while now it doesn't seem to.
>> So, I could replace "wait" with "sleep" and take of the enable/disable
>> code. However I like that the control goes gray when disabled... right
>> now
>> I can't figure out nice solution for this.
>>
>>
>> Jussi
>
> It works with gb.qt4 by luck in your case. Actually neither gb.qt4 or
> gb.gtk likes when WAIT is called during a keyboard event (or mouse
> event), because it messes their internal event process up.
>
> --
> Beno?t Minisini
>
>
>
> ------------------------------
>
> ------------------------------------------------------------------------------
> Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
> from Actuate! Instantly Supercharge Your Business Reports and Dashboards
> with Interactivity, Sharing, Native Excel Exports, App Integration & more
> Get technology previously reserved for billion-dollar corporations, FREE
> http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
>
> ------------------------------
>
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>
>
> End of Gambas-user Digest, Vol 103, Issue 37
> ********************************************
>
More information about the User
mailing list