Hello,
I am trying to use the automation control to retrieve data from a database as per the following codes:
I am able to compile the code successfully but when running the page, I am getting the error: The Automation Variable has not been instantiated.
Version : NAV 2013 R2.
ConnectionString := 'PROVIDER=SQLOLEDB;SERVER=' + ServerName + ';DATABASE='+DatabaseName+';UID='+USER+';PWD='+Password;
IF ISCLEAR(ADOConnection) THEN BEGIN
IF NOT CREATE(ADOConnection,FALSE,TRUE) THEN BEGIN
ERROR('Cannot create ADO Connection automation variable');
END;
END;
IF ISCLEAR(ADORecordSet) THEN BEGIN
IF NOT CREATE(ADORecordSet,FALSE,TRUE) THEN BEGIN
ERROR('Cannot create ADO Recordset automation variable');
END;
END;
ADOConnection.ConnectionString(ConnectionString);
ADOConnection.Open;
While debugging the code is breaking at IF NOT CREATE(ADOConnection,FALSE,TRUE) THEN BEGIN
Can you please help.
Thanks
Bhavna
0
Answers
Why dont you use dotnet? I know its a habit to go back to the automation stuff we already know, but from 2013R2 forward there is no reason to use automations anymore.
My objective is to read data from an external SQL database and insert in Navision Tables. How am I going to achieve this using .NET???