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
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