Is this a bug in DatabaseRecord

I keep getting a “parameters are not compatible with this function” error whenever I do anything more than use a variable when add to a DatabaseRecord for example:

OrderItemsRow.IntegerColumn("Quantity") = ProductQuantity(lp)

Well, maybe you split it?

Does ProductQuantity return integer?
You pass right parameter to ProductQuantity?

The data is correct, it just seems that you cannot pass any parameters in to the function for example.

dim s as string = "12345" OrderItemsRow.IntegerColumn("Quantity") = s.val
or

OrderItemsRow.IntegerColumn("Quantity") = val(s)

Both give you the same error. The only way around is to create a new specific variable where you do the conversion first and then use that variable, seems like a bug to me.

Try assigning Integer(s.val). “Assigns” function semantics can be a bit stringent.

This error is not related to OrderItemsRow.IntegerColumn(“Quantity”), but to ProductQuantity(lp). Because this works:

dim s as string = "12345" OrderItemsRow.IntegerColumn("Quantity") = s.val // and Val(s) will also work

[quote=92312:@Nathan Wright]The data is correct, it just seems that you cannot pass any parameters in to the function for example.

dim s as string = "12345" OrderItemsRow.IntegerColumn("Quantity") = s.val
or

OrderItemsRow.IntegerColumn("Quantity") = val(s)

Both give you the same error. The only way around is to create a new specific variable where you do the conversion first and then use that variable, seems like a bug to me.[/quote]
No error here with

[code] dim orderitemsrow as new databaserecord

dim s as string = “12345”
OrderItemsRow.IntegerColumn(“Quantity”) = s.val[/code]

There’s something else going on

Ok, full Windows shutdown and restart and the error has gone away. Man I hate Windows!! Thanks everyone.

See my post from March: ■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■-crazy-fix/

I had a similar situation this weekend where SQLite was always reporting a database error. Cleared the plugin cache and restarted the computer and voila! The problem went away. This was on Mac OS X so it’s not just Windows. I think there’s something in Xojo that corrupts the plugin cache. It doesn’t happen very often so I’ve never been able to reproduce the issue for Joe R to figure out what it is.

I feel so much better now knowing that it Xojo also fails on Mac OS X as well :wink: I ended up writing a little script a while back that every weekend it deletes the Xojo plugin cache as on Windows I find that things get much slower with Xojo over time. Part of this is probably because I dont come out of Xojo much, maybe only once a week but removing the plugins cache really does help.

@Nathan Wright , just to complete your last answer:
Man I hate OSX!! Thanks Bob. :wink:

I have been a PC user for the past 25+ years and love/hate them but have to say that every time I get to play with a Mac (my son has a 2006 iMac in is bedroom) I am always blown away with how fast and rock solid they are. Having now got really into coding with Xojo I am seriously thinking about getting an iMac desktop machine for coding etc as I feel I waste so much time using Windows which I would recover very quickly using a Mac. Even my sons 2006 iMac is faster than my all singing all dancing laptop running Windows 8.1. I am just about to upgrade is iMac with more ram, a faster processor and an SSD as he likes to do animations etc and I am sure this will make it thunder along.

http://c3201142.cdn03.imgwykop.pl/comment_Z0rs1XaWKXCR7n1mn9lNWwjmEueliLxw.gif

:wink: Love it!

Just for clarity, the video and not the person.

I love to make jokes with him because he is seriously funny.

You should download MacTracker if you haven’t done so already. It is free and contains all the info for the various models (like max RAM that they can take).