Anyone willing to give this function a try and let me know

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|

Anyone willing to give this function a try and let me know

Drew Jensen
Hi,

Attached is a small basic module.
If you would be willing to hep me check it out:

Import the bas file into a basic library embedded in an ODB file - will
not work as a stand alone Basic library

Create a form with the Property Insert Data Only true.
You should make sure the dataform Cycle property is set to "Active Record "
You should disable the navigator.

OK - you can add a button to the form, a custom toolbar or a custom menu
assign the macro insertFirstDataForm

Just try it - let me know if you get any errors, please.

I've used it with  HSQLdb and dBase Base files w/out problem.

MS Access has an error in the executeUpdate command on the prepared
statement.

MySQL and PostgerSQL haven't checked.

Anyway, if anyone gives it a try I'd appreciate it.

Thanks

Drew

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

i108377.bas (10K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Allow controls after last data control ( was Re: Anyone willing to give this function a try and let me know)

Drew Jensen
A quick fix - attached is a new version with
a fix to allow forms with things like buttons  ;>)

Also - tried this with MySQL Native Connecter and it kind of works, kind of doesn't...
next email with the question on that.

Thanks



On 2/6/2010 9:35 PM, Drew Jensen wrote:
Hi,

Attached is a small basic module.
If you would be willing to hep me check it out:

Import the bas file into a basic library embedded in an ODB file - will not work as a stand alone Basic library

Create a form with the Property Insert Data Only true.
You should make sure the dataform Cycle property is set to "Active Record "
You should disable the navigator.

OK - you can add a button to the form, a custom toolbar or a custom menu
assign the macro insertFirstDataForm

Just try it - let me know if you get any errors, please.

I've used it with  HSQLdb and dBase Base files w/out problem.

MS Access has an error in the executeUpdate command on the prepared statement.

MySQL and PostgerSQL haven't checked.

Anyway, if anyone gives it a try I'd appreciate it.

Thanks

Drew



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

i108377.bas (10K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Allow controls after last data control ( was Re: Anyone willing to give this function a try and let me know)

Drew Jensen
Last update for tonight. (new file attached)

Added MySQL native connector check, support
As long as the form is based on a table in the schema (catalog) used when the connection was established, it seems to work.

Drew

On 2/6/2010 11:35 PM, Drew Jensen wrote:
A quick fix - attached is a new version with
a fix to allow forms with things like buttons  ;>)

Also - tried this with MySQL Native Connecter and it kind of works, kind of doesn't...
next email with the question on that.

Thanks



On 2/6/2010 9:35 PM, Drew Jensen wrote:
Hi,

Attached is a small basic module.
If you would be willing to hep me check it out:

Import the bas file into a basic library embedded in an ODB file - will not work as a stand alone Basic library

Create a form with the Property Insert Data Only true.
You should make sure the dataform Cycle property is set to "Active Record "
You should disable the navigator.

OK - you can add a button to the form, a custom toolbar or a custom menu
assign the macro insertFirstDataForm

Just try it - let me know if you get any errors, please.

I've used it with  HSQLdb and dBase Base files w/out problem.

MS Access has an error in the executeUpdate command on the prepared statement.

MySQL and PostgerSQL haven't checked.

Anyway, if anyone gives it a try I'd appreciate it.

Thanks

Drew





---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

i108377.bas (11K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Allow controls after last data control ( was Re: Anyone willing to give this function a try and let me know)

Drew Jensen
On 2/7/2010 12:26 AM, Drew Jensen wrote:
> Last update for tonight. (new file attached)
But not quite last question.

Just tried this with SQLite3 ODBC data source.

Fail with error '?' in SQL INSERT not recognized.

We do support prepared statements with parameters under SQLite3 ODBC, yes?

Thanks - and now I suppose that's a good night from me.

Drew
Reply | Threaded
Open this post in threaded view
|

Add ODBC-SQLite3 ( was Re: Anyone willing to give this function a try and let me know)

Drew Jensen
Attached bas file with support for SQLite3 via ODBC

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

i108377.bas (13K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Add ODBC-SQLite3 ( was Re: Anyone willing to give this function a try and let me know)

Drew Jensen
and one with dates working...

now to rewrite the whole thing in js maybe...lol

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

i108377.bas (13K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

i108377 and SQLite ( Re: Anyone willing to give this function a try and let me know)

Drew Jensen
In reply to this post by Drew Jensen
Hwody,

Alright - don't say it - I tossed pretty much all of that.

*IMPORTANT *

Unlike the jdbc/access drivers the odbc(all?)/SQLite3 combination is the
worse possible situation.

The user has a Data Inert Only form.
They try to commit it throws the error.
(Under JDBC/Access only the first try writes data to the table)
With SQLite each time the user commits a new record is inserted
(assuming an Auto_increment PK)
then tells the user there was an error - leaving the GUI ready to save agin.
Do that 10 times you have 10 records of identical data, less the unique
key in your table.
*lovely*
WE really need to let this, small group, of users know in advance of
this bug.

So back to coding

I was hoping that I could, as a work around, just do something like this:

dataform.Cycle = com.sun.star.form.TabulatorCycle.PAGE
dataform.InsertRow
dataform.Cycle = com.sun.star.form.TabulatorCycle.CURRENT
dataform.Reload

- nope that doesn't work the error still triggers.

I've got the code rewitten, using prepStmt / Statement (for SQLite)
without the case statements and a lot more smarts for passes across the
controls
- the performance is a lot better but still not good enough for more
then maybe 20 controls.

Latter today I'll put that up here...just once this time - sorry for the
flurry the other day.

Drew


---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: i108377 and SQLite ( Re: Anyone willing to give this function a try and let me know)

Drew Jensen
And attached is the simplest most generic procedure I could come up with.

So this routine just creates an SQL INSERT STATEMENT

No prepared statement.
No support for IMages or other varbinary data.
Everything is a string.
No use of a cataloge (schema) name

Ran it against a few forms I had for each
HSQLdb, MS Access, MySQL Native, ODBC/SQLite3

Note - I gave up trying to force a commit of the GUI controls to the
bound data columns.
To SLOW...

Drew

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

i108377.bas (7K) Download Attachment