Parameters are not compatible with this function

[code] //saving data for the Person type
dim therowID as Integer
dim row as new DatabaseRecord

dim dateBool as Boolean
dim theDate as new Date
dim nowDate as new Date

//read last row ID/
therowID = GetLastRowID(“CDD2_Person”,“P_ID”)

row.column(“P_ID”) = therowID+1[/code]

I get a compiler error on the last line of code stating that the ‘Parameters are not compatible with this function’
Which function? My function GetLastRowID simply returns an integer.

If I do this:

row.column("P_ID")  = 124 

Still the same error. I don’t get it…

[Edit]

the column type is definitely Integer, but if I change the rowID into a string it compiles… huh?

row.column(“P_ID”) .IntegerValue = therowID+1

Sounds like stupid me… Thanks!

Errr… wait a minute… I’m trying to put some data INTO the table, not to retrieve it.

If I place “.IntegerValue” behind it the compiler reacts with 'This item does not exist"

DatabaseRecord.Column expects a string, not an integer. What Norman meant was

row.IntegerColumn(“P_ID”)= therowid+1

His code would have been correct for a RecordSet. Please refer to the documentation for DatabaseRecord.

That said, incrementing a row ID value yourself is generally a bad idea. Is there a reason you’re not letting the database do it for you?

Hi Tim,

The database is SQLite, I defined this column as Integer and Autoincrement but I found out (due to errors I suspect now) that it didn’t increment. I wil redefine the column and test again.

Thanks.

Works like a charm.