hy i m working with webdev , i have combobox and table in my page , combobox have value of names of tables databse sql server ,i want when i select value of combo show data of table in my table, my table in project have 11 column but the tables i select from can be more or less
this is my code navigateur in select value from combo box :
projet is string = Project.Valeur
res is array of string
//res = new array of nbrligne string
res = AJAXExécute(Get_project_label,projet)
i is int =1
// Process the received data
SI res <> Null ALORS
Info("nbr ligne est = "+res.Occurrence())
WHILE i <= res.Occurrence()
TableAjoute(Table_label,res[i])
i++
FIN
ELSE
Info("nbr ligne est null")
FIN
and this is my procedur with ajax activ:
PROCÉDURE Get_project_label(nameproject is string)
// open connexion to database
datalabel is array of string
nbrligne is int =0
ConnectionNum is int = SQLConnect("*****", "******", "odbc_matrack", "*****", "OLEDB", hOledbSQLServer)
IF ConnectionNum <> 0 THEN
// The connection was successful
x is int = 1
y is int = 1
i is booléen = SQLExec("SELECT * FROM ["+nameproject+"]","qr")
IF i THEN
WHILE SQLFetch("qr") = 0 // There is still another line to read
nbrligne++
END
SQLInfo()
ResNbColl is int = SQL.NbCol
datalabel = new array of nbrligne string
WHILE x <= nbrligne// There is still another line to read
WHILE y <= ResNbColl
datalabel[x] = SQLGetCol("qr",y)
y++
END
x++
END
RETURN datalabel
ELSE
SQLInfo()
Error("The query is failed." + CR + ...
"Error code: " + SQL.Error + CR + SQL.MesError)
END
SQLClose("qr")
ELSE
// The connection failed: display an error message
SQLInfo()
Error("The connection to the data source failed." + CR + ...
"Error code: " + SQL.Error + CR + SQL.MesError)
END
// In any case (connection OK or not)
SQLDisconnect()
webdev when i select combobox show result in table from query sqlexec()