Page 1 of 1

Adding data to a Mysql database error

PostPosted: Sun Oct 13, 2013 4:03 pm
by DaveJ
Hi Guys, not sure if this is the right area to post this but thought you might find it useful.

I have been importing an external database via a CSV file into a MYSQL database.
Everything was going fine and then Neobook kept crashing.
I created an array from the CSV file and was using this bit of code..

.Check if item is already in database and add if not
dbpFind "database" "parts" "allparts" "[import_array3]" "ExactMatch=Yes;CaseSensitive=No"
If "[dbpError]" "=" "No matching records found."
dbpAddRecord "database" "parts"
SetVar "[]" "[import_array3]"
SetVar "[]" "[import_array4]"
dbpSaveEdits "database" "parts"

I eventually realised that the variable [import_array3]'s content was bigger than allowed for that field in my database.
I got no error other than a non responsive program.
I corrected it by adding SubStr "[import_array3]" "1" "13" "[import_array3]" to the start of the code.
Maybe a bug?

Dave J

Re: Adding data to a Mysql database error

PostPosted: Mon Oct 14, 2013 10:40 am
by Neosoft Support
Thanks for the report. I'm glad that you found a work-around. I'm not exactly sure why this would crash your app. It seems like when I've done something similar in the past with MS Access databases, the content is automatically truncated if it's larger than the field can accommodate. This may be something specific to MySQL or a specific version of MySQL. Anyway, I will print your message and add it to our list of things to look into for the next update. Sorry for the inconvenience.