Source language: Translate to:

Adding data to a Mysql database error

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Adding data to a Mysql database error

Postby DaveJ » Sun Oct 13, 2013 4:03 pm

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 "[database.parts.allparts]" "[import_array3]"
SetVar "[database.parts.part_description]" "[import_array4]"
dbpSaveEdits "database" "parts"
EndIF

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
DaveJ
 
Posts: 90
Joined: Tue Dec 30, 2008 11:06 am

Re: Adding data to a Mysql database error

Postby Neosoft Support » Mon Oct 14, 2013 10:40 am

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.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5602
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 3 guests