|
Loading a table with UN QUERY |
Débuté par Manuel, 19 sep. 2008 11:08 - 2 réponses |
| |
| | | |
|
| |
Posté le 19 septembre 2008 - 11:08 |
colleagues (as)
I have a control board to view the records of a database
The problem is that I need to do it through the client code.
I do so if it works well
mdatos1 is Data Source HExecuteSQLQuery(mdatos1, "SELECT ORDEN,FECHAO,DES,TOTAL,TIPO,CODIGO FROM ordenes WHERE CODIGO = ' 5072' ")
Table1..BrowsedFile = mdatos1
but I need the client indicating the code if I create a variable to store the value
m is string m = DCUENTA
mdatos1 is Data Source HExecuteSQLQuery(mdatos1, "SELECT ORDEN,FECHAO,DES,TOTAL,TIPO,CODIGO FROM ordenes WHERE CODIGO = m ")
Table1..BrowsedFile = mdatos1
does not show anything, but if m has the correct value.
any idea
Thank you |
| |
| |
| | | |
|
| | |
| |
Posté le 19 septembre 2008 - 12:28 |
Hi !
-------------------- On 19-Sep-2008, Manuel <soporte@kronoscr.com> wrote:
mdatos1 is Data Source HExecuteSQLQuery(mdatos1,... "SELECT ORDEN,FECHAO,DES,TOTAL,TIPO,CODIGO FROM ordenes WHERE CODIGO = m") -----------------------
You should write your query like this : SELECT ORDEN,FECHAO,DES,TOTAL,TIPO,CODIGO FROM ordenes WHERE CODIGO = '"+ m +"'" where '" is a single quote followed by a a double quote and "'" is a double quote + a single quote + a double quote. Why ? Read the query with a fixed value, you did set the value between single quotes, you have to do the same with variables !
Hope this helps !
-- Marcel Berman Président of Be-Dev.be (www.be-dev.be) (Belgium) Member of Wind'Asso's Board (www.windasso.org) (France) Be-Dev.be et Wind'Asso are User's group of PC-Soft's products |
| |
| |
| | | |
|
| | |
| |
Posté le 19 septembre 2008 - 19:26 |
| |
| |
| | | |
|
| | | | |
| | |
|