Information générale
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Hello Everybody,
I am trying to retrieve data from MySQL database. I was using the following method till now.
1. Create a user DSN ('mySqlODBC')
2. lha = sqlConnect('mySqlODBC')
3. lcQry = "Select u.userid Id, concat(u.firstname, ' ', u.lastname) Name, from loans as l "
4. lnResult = SQLEXEC(lha, lcQry, 'cmpData')
5. SELECT cmpData
I was trying to get rid of the process to create user DSN, hence tried the following
1. mySQLCn = "driver=MySQL ODBC 3.51 Driver;server=192.168.2.2;uid=####;pwd=##"
2. lha = SQLSTRINGCONNECT(mySQLCn,.T.)
3. lcQry = "Select u.userid Id, concat(u.firstname, ' ', u.lastname) Name, from loans as l "
4. lnResult = SQLEXEC(lha, lcQry, 'cmpData')
5. SELECT cmpData
However now I get the error "cursor cmpData not found". It looks like that SQLEXEC is failing.
Is there anything wrong I am doing ? Kindly suggest.
Many thanks in advance,
Abhi
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement