I have a huge system that is working fine with version 1.9.9.
I'm moving to 2.5 and I found the following isues:
1. Query, now, need to be opened.
before:
QClient := oTMySQLDataSource:Query("SELECT Name, Id FROM Client")
outdebug(QClient:Name)
now:
QClient := oTMySQLDataSource:Query("SELECT Name, Id FROM Client")
QClient:Open()
outdebug(QClient:Name)
It's ok, just a few work to review the code and open the query, no problem... but net next is complicated!
2. TDBNavigator loose its oDataSet object if I need to close and reopen the query. I could not be able to reproduce this behavior.
Where is the code that is working on 1.9.9:
PROCEDURE vwQuery_Refresh(p, txt)
LOCAL lFlag
LOCAL s := p:cSelect
LOCAL i := at("WHERE", s) + 6
LOCAL j := at("ORDER BY", s) - i - 1
LOCAL w := substr(s, i, j)
LOCAL m, o
LOCAL lc := p:aLinkedControls
WITH OBJECT p
lFlag := Len(lc) > 0 // to know if the query is linked with some datacontros
:lOpen := .F. // close it (I cound't find another way to update de query
// recreate the select statement
IF w[1] = "("
j := 1
m := 0
DO WHILE (j <= Len(w)) .AND. (iif(w[j] = "(", m++, iif(w[j] = ")", m--, Nil))) > 0
j++
ENDDO
ENDIF
:cSelect := stuff(s, i, j, txt)
:lOpen := .T. // reopen it
// here I search for something wrong with linked controls!
FOR EACH o iN :aLinkedControls
IF o:oDataField = NIL .and. lFlag
messagebox(p:cname + CRLF + o:ClassName())
o:oDataSet := p // so, I have to "update" the dataset! It does not happen with 1.9.9
ENDIF
NEXT
END
RETURN
I tried to use the sqlparams, but I got the same error.
It's taking so much time to discover this king of errors!
In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.
problem with TDBNavigator with mySQL
problem with TDBNavigator with mySQL
Sir,
It's a realy complex problem! I still can be wrong, but I think the real problem is that lAllowProcessMessages is True. So, when a query is being executed the program continues and
can't find the expedted oDataField that the query will return! I turned it off (false) and tested all again... seems to work know, but I'm not sure. Does it make any sense?
It's a realy complex problem! I still can be wrong, but I think the real problem is that lAllowProcessMessages is True. So, when a query is being executed the program continues and
can't find the expedted oDataField that the query will return! I turned it off (false) and tested all again... seems to work know, but I'm not sure. Does it make any sense?
problem with TDBNavigator with mySQL
Roberto,
> It's a realy complex problem! I still can be wrong, but I
> think the real problem is that lAllowProcessMessages is
> True. So, when a query is being executed the program
> continues and can't find the expedted oDataField that the query will
> return! I turned it off (false) and tested all again...
> seems to work know, but I'm not sure. Does it make any
> sense?
Yes, it fully makes sense. When ProcessMessages() is used, the program
doesn't continue from that point, but it does process every pending
event and windows messages, so it can execute other code where the
dataset is closed, just before continuing the execution at that point.
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info
> It's a realy complex problem! I still can be wrong, but I
> think the real problem is that lAllowProcessMessages is
> True. So, when a query is being executed the program
> continues and can't find the expedted oDataField that the query will
> return! I turned it off (false) and tested all again...
> seems to work know, but I'm not sure. Does it make any
> sense?
Yes, it fully makes sense. When ProcessMessages() is used, the program
doesn't continue from that point, but it does process every pending
event and windows messages, so it can execute other code where the
dataset is closed, just before continuing the execution at that point.
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info