i am facing very strange scenario,
When i am fetching records from mysql database i am getting Nil value for the all columns whose datatype is ‘int’ and length is 1.
i am using mysql as database. and wrote following code to retrieve data.
sql = "select StoreCode from tblstorefile"
dim data as RecordSet
data=app.db.SQLSelect(sql)
if data <> Nil then
txtStoreCode.Text = data.Field("StoreCode").StringValue
Where i am doing wrong.
Maybe read an integer value?
txtStoreCode.Text = str(data.Field("StoreCode").IntegerValue)
[quote=462180:@]Maybe read an integer value?
txtStoreCode.Text = str(data.Field("StoreCode").IntegerValue)
i tried it but not worked.
if change the datatype to double from int then it works fine, but i can’t do that as my database is already ready.
so want to know where i am going wrong so that i can fix issue.
What version of xojo are you using?
Is the StoreCode column defined as INT(1) ?
[quote=462199:@]What version of xojo are you using?
Is the StoreCode column defined as INT(1) ?[/quote]
yes StoreCode column is defined as INT(1).
i am using xojo 2017 r2. if i upgrade it, will that help?
I just tried it on 2017r2 and it worked fine so its not a bug in an older version.
Pop a break after data=app.db.SQLSelect(sql) and inspect the data variable in the variables viewer and see if there’s data returned?
What version of mysql are you using?
What value are you trying to retrieve from the INT?
[quote=462212:@]I just tried it on 2017r2 and it worked fine so its not a bug in an older version.
Pop a break after data=app.db.SQLSelect(sql) and inspect the data variable in the variables viewer and see if there’s data returned?[/quote]
hi Julian,
Problem get solved after i upgrade to latest version(2019 r2) without doing any change in source code.
Thanks.