Microsoft ACE DatabaseEngine 2010 driver (12.0) Problem, after Windows 10 1909 Cumulative Updates (and later) - vb.net

since cumulative Windows 10 1909 Updates are installed, I get following exception when accessing MS Access accdb.
: An external component raised an exception.
After reinstalling Microsoft ACE DatabaseEngine 2010 (OLEDB.12.0 ..), all works fine again.
What can I do about it?
Dim sel As String = "Select Notiz from T_TerminNotiz where ztrText=#ztrText and serNr=#serNr"
Using myConnection As New OleDbConnection(myConnStringX1)
myConnection.Open()
Using mySqlCmd As New OleDbCommand(sel, myConnection)
mySqlCmd.CommandType = CommandType.Text
mySqlCmd.CommandTimeout = myCmdTimeOut
mySqlCmd.CommandText = sel
mySqlCmd.Parameters.Clear()
mySqlCmd.Parameters.Add(New OleDbParameter("#ztrText", OleDbType.VarChar)).Value = strKlient
mySqlCmd.Parameters.Add(New OleDbParameter("#serNr", OleDbType.Integer)).Value = serNr
oRet = mySqlCmd.ExecuteScalar()
End Using
End Using

Microsoft announces (Known issues with Office and Windows 10) that included Office 2010, but did not specify any technical details for developers.
However, you did the best thing, considering that you will (anyway) provide DatabaseEngine 2010 Redist for the client.
Sometimes, the problem is
due to a mismatch between the build configuration platform of your
project and the Microsoft Access Database Engine which is installed on
your machine.
As stated in this answer [by/ Katia]. Hope this helps. Best of luck.

after some tests, I found following solution to my problem.
Installing Microsoft DatabaseEngine 2016.
I activated all OLE DB Services by adding it into configuration file xxx.config.
...
connectionString="Provider=Microsoft.ACE.OLEDB.16.0;Data Source=Table.accdb;Persist Security Info=True;OLE DB Services=-1;

Related

Microsoft Access Database Engine causing fatal communications error with Windows Process Activation

I'm using the Access Database Engine Redistributable to read an Access database in my .net application and for some reason whenever I use a join to query data from the access database to fill a datatable it causes a fatal communications error with the Windows Process Activation Service. I can populate datatables without issue as long as there is only one table. As soon as I add just one join, I get the system error. There are no errors in my application to trap, the system error occurs and then the application stops processing. This is only happening on one server. My local computer doesn't seem to have this issue. I'm using the exact same redistributable on my local computer and the server. Two things boggle my thinking why does a join cause an issue and why does it cause a system error and doesn't push it up to the app? If I'm using a single table query, it works fine.
Steps to populate datatable:
accessConnection = New
System.Data.OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0; Data Source='" &
uploadedFileName & " '; Persist Security Info=False;")
accessDataAdapter = New System.Data.OleDb.OleDbDataAdapter("select * from Table1 INNER JOIN
Table2 ON Table1.PK = Table2.PK", accessConnection)
accessDtSet = New System.Data.DataSet
accessDataAdapter.Fill(accessDtSet) - Application fails here
accessView = accessDtSet.Tables("Locations").DefaultView
This is just a guess but maybe try the following provider in your connection string:
Provider=Microsoft.Jet.OLEDB.4.0

Existing LINQ to Entities queries throw exception on upgrade to VS 2017

We recently upgraded our visual studio from 2013 to 2017, are working on with EntityFramework 6.1.3, and with the upgrade have our projects targetting the 4.7 .NET Framework. With these changes we have existing LINQ queries that are breaking on us.
A simplified example:
Dim comm = Communication.Where(Function (t) t.Id = 1).ToList()
Dim query = (From cc In comm
Let a = ""
Select New With {
.UserName = (From e In Employee
Where e.Initials = cc.EmployeeInitials
Select ee.UserName).FirstOrDefault()
}
)
In this situation the result will be a System.NotSupportedException with the message being:
LINQ to Entities does not recognize the method 'Company.Core.Models.Communication get_cc()'
Now removing the Let statement from the query fixes the exception and the query will run fine, however I cannot determine why the Let causes problems and more specifically why this query only recently broke.
So I am hoping someone can give a explanation of why this exception cropped up in VS 2017 when it had worked fine in VS 2013 and in our production system for years.

ORA 06401 invalid driver designator

I have a old VB .NET application.
It works with oracle 11 personal edition.
i move this application in other server with oracle 12 C enterprise edition and the application dont connect herself to DB with the following error code."ORA 06401 invalid driver designator ".
This is the connection string "Provider=OraOLEDB.Oracle;Password=xx User Id=yy DataSource=//localhost:1521//zzz extended Properties=;"
Probably is a very trivial mistake but I 've already lost a day
Thanks to all
Gian

SQL Anywhere connection error: The driver doesn't support the version of ODBC behavior that the application requested

I'm trying to connect to a SQL Anywhere 5 database (I know it's olllld!) with a .NET 3.5 app in WinXP and it works fine from a stand alone console app. But when I run the exact code in a plugin ,running off a separate AppDomain, (the only difference I can tell between the two) with the following code, I get the errors further below.
BTW Both are executed as the SAME user.
using (OdbcConnection connection =
new OdbcConnection(strConnect))
{
OdbcCommand command = new OdbcCommand(query, connection);
command.CommandType = CommandType.Text;
DataTable posRecordsTable = new DataTable();
connection.Open();
OdbcException Exception returns the following errors:
Index #0
Message: [Sybase][ODBC Driver]Unable to connect to database server: database engine not running
Index #1
Message: [Sybase][ODBC Driver]Invalid connection string attribute
Index #2
Message: [Sybase][ODBC Driver]Invalid connection string attribute
Index #3
Message: [Microsoft][ODBC Driver Manager] The driver doesn't support the version of ODBC behavior that the application requested (see SQLSetEnvAttr).
Does the driver on your AppDomain have the same configuration as your stand alone box? I think checking the similarity of the environments will help you. Usually such errors are resolved by looking at the config files from where the driver reads its information. Dont know much about SQL Anywhere, but in general, I've come across such issues and I fixed them by altering the connection information or the configuration file.

Delphi - Either BOF or EOF is True, or the current record has been deleted

This error showed when I tried to select on an empty table in MS SQL Server 2005: "either BOF or EOF is True, or the current record has been deleted". I have used TADOConnection and TADODataSet in Delphi 5 to connect and retrieve data from the database.
Conn := TADOConnection.Create(nil);
DataSet := TADODataSet.Create(nil);
Conn.ConnectionString := 'Provider=SQLOLEDB.1;Password=sa;' +
'Persist Security Info=True;' +
'User ID=user;Initial Catalog=mydb;' +
'Data Source=MYPC\SQLEXPRESS;' +
'Use Procedure for Prepare=1;' +
'Auto Translate=True;Packet Size=4096;' +
'Workstation ID=MYPC;' +
'Use Encryption for Data=False;' +
'Tag with column collation when possible=False';
Conn.LoginPrompt := False;
Conn.Open;
DataSet.Connection := Conn;
DataSet.CommandText := 'SELECT * FROM MYTABLE';
DataSet.Open;
DataSet.Free;
Conn.Free;
Is there a way to check if a database table is empty without incurring such error?
This error originally occured with an update to MDAC_TYP (to 2.6 from memory). According to an old Borland advisory
"This is a bug in the SQL Server provider. Set
CursorLocation = clUseClient to eliminate the error."
There was a ADOExpress patch available from Borland, but the link doesn't work. Embarcadero now host it here: ftp://ftpd.embarcadero.com/pub/delphi/devsupport/updates/adoexpress/d5adoupdate2.exe(Thanks for the official link Jeroen!)
I would recommend downloading and installing all patches listed on the Embarcadero site, assuming you can find them.
Download the ADO update for Delphi 5 here: ftp://ftpd.embarcadero.com/pub/delphi/devsupport/updates/adoexpress/d5adoupdate2.exe
Make sure you also have the regular update installed:
English Enterprise
English Professional
English Standard
There are more updates (Corba, original ADO install) and languages (French, German), but these should get you going.
There also used to be a http://info.borland.com/devsupport/delphi/download_files/zlibupdate.zip, but it is not on the ftpd servers.
--jeroen
It was long time agom but I recall that this problem in Delphi 5 resolves by Delphi update. Early version has serious problems with ADO components
P.S. Also I see that your code uses not typical runtime creation of components and does not use some container like data module or form (not good usually) for visual work with components. Also sometimes useful run simple queries via adoConnection.execute. If you do not use visual components, handling of ADO's Recordset object is much the same as Delphi's AdoDataset.
Since I spent a whole day on this, here is a wrap up of what I did in the end.
Delphi 5 Pro Installation with ADO Express
Uninstall Delphi 5, also deleted installation directory
Install Delphi 5 Pro (I only have a German Delphi Pro edition available)
Install Delphi 5 Pro Update (I used the German update)
Install Delphi 5 ADO Express
Install Delphi 5 ADO Express Update Pack 1
Install Delphi 5 ADO Express Update Pack 2
And the download links (many thanks again Jeroen Wiert Pluimers):
Delphi 5 Pro updates:
ftp://ftpd.embarcadero.com/pub/delphi/devsupport/updates/delphi5/D5ProUpdate.exe
ftp://ftpd.embarcadero.com/pub/delphi/devsupport/updates/delphi5/german/d5proupdate.exe
ADOExpress Update Packs 1 and 2:
ftp://ftpd.embarcadero.com/pub/delphi/devsupport/updates/adoexpress/D5ADOUpgrade.exe
ftp://ftpd.embarcadero.com/pub/delphi/devsupport/updates/adoexpress/d5adoupdate2.exe
And for future reference some screenshots to build the download links (case sensitive):