I try to connect to a database by using the ADO component.
The connection is established, the selection of data did not pose a problem to me, but I do not manage to recover the contents of my RecordSet (property Fields).
This error is raised: The method was called with a non - valid number of parameters.
Could you help me?
Sample code:
static void ADOEssai(Args _args)
{
COM cnx;
COM rst;
str strQuery; str strTmp; ;
try
{
cnx = new COM('ADODB.Connection');
cnx.Open("DSN=Essai"); //;UID=admin;PWD=;");strQuery = "SELECT * FROM Produits";
rst = new COM('ADODB.Recordset');
rst.Open(strQuery,cnx); if(rst.EOF())
{
info("Recordset empty");
}
else
{
info("Recordset not empty");
} while(!rst.EOF())
{
// this code don't run. This exception is raised :
// "The method was called with a non - valid number of
// parameters."
info(rst.Fields('Description')); // move to the next record
rst.MoveNext();
} cnx.Close();
rst = null;
cnx = null;
}
catch(Exception::Error)
{
cnx = null;
Error("error");
}
}Thanks,
Vario.
Yahoo! Groups Sponsor
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

