BaseForms: transferring contents of data fields to the database table

classic Classic list List threaded Threaded
4 messages Options
Egbert Eissing Egbert Eissing
Reply | Threaded
Open this post in threaded view
|

BaseForms: transferring contents of data fields to the database table

I have a main form and a sub form.
The main form holds one single record, the sub form contains multiple records related to the record in the main form.
Both forms are holding alphanumeric and also pure numeric data.
I wrote a macro to evaluate and calculate the numeric data in the sub form and deposit the results in fields of the main form.

Now my problem: The numbers placed in the main form fields by means of the macro are not recognized by the back end MySQL database. These simply are not transferred, whatever I do. (If I write some figures in manually, the same are being transferred without problem.) What can I do to work around this problem? Is there any kind of trick that makes the form believe that the automatically generated data have been put in by hand and treated accordingly? I am sure there must be a solution to this.
Thanks for any help.

--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Andreas Säger Andreas Säger
Reply | Threaded
Open this post in threaded view
|

Re: BaseForms: transferring contents of data fields to the database table

Am 05.01.2016 um 04:24 schrieb Egbert Eissing:
> I have a main form and a sub form.
> The main form holds one single record, the sub form contains multiple records related to the record in the main form.
> Both forms are holding alphanumeric and also pure numeric data.
> I wrote a macro to evaluate and calculate the numeric data in the sub form and deposit the results in fields of the main form.
>
> Now my problem: The numbers placed in the main form fields by means of the macro are not recognized by the back end MySQL database. These simply are not transferred, whatever I do. (If I write some figures in manually, the same are being transferred without problem.) What can I do to work around this problem? Is there any kind of trick that makes the form believe that the automatically generated data have been put in by hand and treated accordingly? I am sure there must be a solution to this.
> Thanks for any help.
>

Please refer to other peoples working code. There are far too many
problems and pitfalls with this API to answer this question out of thin air.


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Alex Thurgood Alex Thurgood
Reply | Threaded
Open this post in threaded view
|

Re: BaseForms: transferring contents of data fields to the database table

In reply to this post by Egbert Eissing
Le 05/01/2016 04:24, Egbert Eissing a écrit :

Hi Egbert,

> I have a main form and a sub form.
> The main form holds one single record, the sub form contains multiple records related to the record in the main form.
> Both forms are holding alphanumeric and also pure numeric data.
> I wrote a macro to evaluate and calculate the numeric data in the sub form and deposit the results in fields of the main form.
>
> Now my problem: The numbers placed in the main form fields by means of the macro are not recognized by the back end MySQL database. These simply are not transferred, whatever I do. (If I write some figures in manually, the same are being transferred without problem.) What can I do to work around this problem? Is there any kind of trick that makes the form believe that the automatically generated data have been put in by hand and treated accordingly? I am sure there must be a solution to this.
> Thanks for any help.
>


Without having access to the macro code that you have written, how do
you expect us to be able to help ? It could be that something is missing
in your code, e.g. a commit statement of the form control's value to the
bound database field.



Alex


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Noel Noel
Reply | Threaded
Open this post in threaded view
|

Re: BaseForms: transferring contents of data fields to the database table

In reply to this post by Egbert Eissing
Hi Egbert,

Andrew Pitonyak's "Open Office.org Base Macro Programming" on page 45
states -

The safest solution is to modify the bound field directly. For example,
your current code may be as follows:
oControl.setString("myText")
It is better if you can use the bound field:
oControl.BoundField.updateString("myText")
The required method is dependent on the data type, which is a drawback to
this method. I am aware of at least one instance where the specific method
(updateDate) failed, yet the generate updateString method properly updated
the bound field.

I have found that BoundField.updateString works well in situations such as
yours.  I have also worked out how to cover the problem of using a Macro to
write to a Date field.  If you ever need to do this, I could send you the
code.

​​Noel​
--
Marion & Noel Lodge
[hidden email]

On 5 January 2016 at 14:24, Egbert Eissing <[hidden email]> wrote:

> I have a main form and a sub form.
> The main form holds one single record, the sub form contains multiple
> records related to the record in the main form.
> Both forms are holding alphanumeric and also pure numeric data.
> I wrote a macro to evaluate and calculate the numeric data in the sub form
> and deposit the results in fields of the main form.
>
> Now my problem: The numbers placed in the main form fields by means of the
> macro are not recognized by the back end MySQL database. These simply are
> not transferred, whatever I do. (If I write some figures in manually, the
> same are being transferred without problem.) What can I do to work around
> this problem? Is there any kind of trick that makes the form believe that
> the automatically generated data have been put in by hand and treated
> accordingly? I am sure there must be a solution to this.
> Thanks for any help.
>
> --
> To unsubscribe e-mail to: [hidden email]
> Problems?
> http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
> Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
> List archive: http://listarchives.libreoffice.org/global/users/
> All messages sent to this list will be publicly archived and cannot be
> deleted
>

--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted