MySQL ADO Connection

iansilversiansilvers Member Posts: 38
I am having serious problems with trying to retrieve data from an external MySQL database. I can connect to the database, and execute my command, but whenever I try to access any fields within the returned recordset, I am getting datatype not supported
message. Even on something as simple as getting number of records in a table fails, such as
CREATE(Conn);
Conn.ConnectionTimeout := 60000;
Conn.CommandTimeout := 60000;
Conn.Open(DSN,Username,Password);

SQL := STRSUBSTNO('SELECT COUNT(*) AS NoRecs FROM Table');
RS := Conn.Execute(SQL);
EVALUATE(NoRecs,FORMAT(RS.Fields.Item('NoRecs').Value));
RS.Close;

I have tried using CONVERT and CAST in the SQL command passed to MySQL, but not joy. I can place the field into a variable of type variant in Navision, but when I query the variable, it just returns the word "Value".

Anyone got any suggestions?

Comments

  • Igor_PchelnikovIgor_Pchelnikov Member Posts: 25
    Hello,
    check first RS.EOF what value does it return?
    Also provide DSN string here.

    Igor
Sign In or Register to comment.