I'm creating an Excel file linked to an ACT database using ACT OLE DB provider 2.0 All is working fine (credentials approve etc) until I have to select tables from the ACT database to insert, then it gives me this error;
DataSource.Error: An error happened while reading data from the provider: 'Value cannot be null.
Parameter name: pUnk'
Details:
DataSourceKind=OleDb
DataSourcePath=data source="U:\ACTDatabase2011rev3-database files\ACTDatabase2011rev3.pad";provider=ACTOLEDB2.1
I have searched for the error but most answers refer to Visual Studio which I have never used and don't know what it is.
Can someone explain in layman's terms what's wrong here, and what I should do to successfully import the data?
I'm glad I'm not the only one who's had this problem anyway!
In this case I had an excel file from a colleague (an older one made in Excel 2016) that had a working connection, albeit to the wrong table in ACT.
I made a workaround by exporting the connection files (.odc files) of both and comparing them in Notepad, then editing the 'new' connection file to be the 'old' format and somehow miraculously it worked. Still not sure precisely what the issue is, I just changed every single line that was different rather than trying them individually.
And I made a vba macro for editing the .odc files, because I had quite a few to do; see below (password info has been replaced with
EnterPasswordHere
)Which relies on the below, copied/adapted from the internet;
Running these fixed my connections - I then had to double-click the .odc file and they would open in a new excel file. After fixing, I found I could add SQL to the connection in excel (in the connection properties) to filter the incoming data. Presumably I could have left the SQL line in the original files, but I didn't have the time to devleop the macro any further and 'if it ain't broke don't fix it'!!
So I acknowledge it's far from perfect, but it worked for me and I'm putting it here in the hope that someone else can benefit from it too.
Sorry for the long answer post, hope it's helpful to somebody!