Android Question [SOLVED] Invalid parameter index 1 trying to connect to JRDC2

makis_best

Well-Known Member
Licensed User
Longtime User
Hi.

I use on my JRDC2 service one query with three parameters.
B4X:
sql.Select_EGM_HEADER=SELECT ADRegistrationDate, ADCode, Status, Markup, ClientCode \
FROM EGM_HEADER where ADCode like ? AND ADRegistrationDate between ? and ? ORDER BY ADCode Desc;

So with the command I try to pass parameters like
Dim cmd As DBCommand = CreateCommand("Select_EGM_HEADER", Array("ΠΑΡ-ΠΑ00%", "2020-05-04", "2020-05-09"))

But I always get the error


Any idea why that happening?
 

josejad

Expert
Licensed User
Longtime User
Does the sql work in your mysql manager (phpmyadmin?)

Do you get any error executing:
B4X:
SELECT ADRegistrationDate, ADCode, Status, Markup, ClientCode \
FROM EGM_HEADER where ADCode like 'ΠΑΡ-ΠΑ00%' AND ADRegistrationDate between '2020-05-04' and '2020-05-09' ORDER BY ADCode Desc;
 
Upvote 0

yfleury

Active Member
Licensed User
Longtime User
Try this
B4X:
Dim cmd As DBCommand = CreateCommand("Select_EGM_HEADER", Array as string("ΠΑΡ-ΠΑ00%", "2020-05-04", "2020-05-09"))
 
Upvote 0

makis_best

Well-Known Member
Licensed User
Longtime User
I find the problem....
The real reason was time out error.
After I increase the time waiting the problem gone.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…