Open another database

wirowiro Member Posts: 92
edited 2006-02-23 in Navision Attain
Hi again.
I want to open another database from navision (Ms. Access). I'm using Microsoft ActiveX Data Objects 2.8 Library. But i have problem with recordset. How to use it ?
Thank you.

Comments

  • ara3nara3n Member Posts: 9,256
    Hello.
    Have you tried the search functionality?


    Here is a start.
    http://www.mibuso.com/forum/viewtopic.php?t=2976&highlight=recordset+access
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • wirowiro Member Posts: 92
    I have, maybe too many list so i didn't open all of them.
    But thank you.
  • wirowiro Member Posts: 92
    Sorry, i ask again :D
    I can't open the fields and i don't know if the connection is right.
    Coz no error.
    I use recordcount but its wrong count.
    Thanx again.
  • wirowiro Member Posts: 92
    Hi again.

    I have tried and it works.


    IF ISCLEAR(ADOConnection) THEN
    BEGIN
    IF NOT CREATE(ADOConnection) THEN
    ERROR('Can no create ADO Connection automation.');

    ADOConnection.ConnectionString('provider=Microsoft.Jet.OLEDB.4.0');
    ADOConnection.Open('c:\wiro\database-gwe.mdb');

    IF ISCLEAR(adoRS) THEN
    BEGIN
    IF NOT CREATE(adoRS) THEN
    ERROR('Can not create ADO Recordset automation.');

    strSQL := 'select * from Employee';
    RecordsAffected := '';
    rsOption := 0;
    adoRS := ADOConnection.Execute(strSQL,RecordsAffected,rsOption);
    adoRS.MoveFirst;
    REPEAT
    ii := ii + 1;
    VariantName := 'Name';
    adoField := adoRS.Fields.Item(VariantName);
    VariantValue := adoField.Value;
    MESSAGE('%1\Name : %2\Index : %3',ii,adoField.Name,VariantValue);
    adoRS.MoveNext;
    UNTIL adoRS.EOF;
    END;
    END
    ELSE
    MESSAGE('Component is not clear.');
Sign In or Register to comment.