Options

ADO Connect on Server

krishnamkkrishnamk Member Posts: 27
Dear Friends,

I am getting error when I run this code
===================

// the code
// replace the server ip and the ext. databasename with your values
//ReadFromExternalDatabase()

connString := 'Driver={SQL Server};Server=192.168.1.10;Database=Timesheet';

IF ISCLEAR(ADOConnection) THEN
CREATE(ADOConnection);

IF ISCLEAR(ADOConnection) THEN
CREATE(ADOConnection,FALSE,TRUE);

IF ISCLEAR(ADORecSet) THEN
CREATE(ADORecSet);

IF ISCLEAR(ADOStream) THEN BEGIN
IF NOT CREATE(ADOStream) THEN BEGIN
ERROR('Cannot create ADO Stream automation variable.');
END;
END;

ADOConnection.Open(connString);
MESSAGE('Conneciton Created');

ADORecSet.Open('Select name,Convert(Varhcasr,ISNULL(salary,0)) from master',ADOConnection)

Will please help me
kmk

Answers

  • Options
    krishnamkkrishnamk Member Posts: 27
    iy7gvz13yvau.jpg
  • Options
    bbrownbbrown Member Posts: 3,268
    Automation is not supported on the NAV Server. Use .NET InterOp
    There are no bugs - only undocumented features.
Sign In or Register to comment.