The code in the help file works in many situations, but not in all, especially in Windows 8.1, Windows Server 2012.
Make sure you get the latest version of InterBase_ADO.NET from embarcadero. The version I updated to version 16.0.4327.44959 Borland.Data.AdoDbxClient.dll. (Right-click the file, properties, details to see the version number). The installation also creates a version 64 folder for the 64-bit version, although I did not use it. I aimed at x86 without any problems.
This installation of ADO.NET does not have to be done on every computer - you just need to include the following files in your project and install Interbase on the computer you are running on. I installed the driver only on my development computer.
The installation will extract all the necessary files necessary for installation in the application to connect to the database. He will also create a readme ADO_NET 2_0 driver for the installation and use of InterBase XE.htm. IMPORTANT NOTE: the DB connection examples in this htm help file do not work 100% of the time. See my sample code below for a solution.
No ODBC connection. The list of files that will be included in your .NET project and copied locally is as follows:
- Borland.Data.AdoDbxClient.dll
- Borland.Data.DbxCommonDriver.dll
- Borland.Data.DBXInterBaseDriver.dll
- Borland.Delphi.dll
- Borland.VclDbRtl.dll
- Borland.VclRtl.dll
- dbxadapter.dll (x86 or x64 version)
- dbxint.dll (x86 or x64 version)
- gds32.dll (from the installation of the inter-database database)
- interbase.msg (from the interbase database database)
I found two connection strings that worked. To connect, use one of the two connection strings:
connectionstring1 = "DriverName=Interbase;Database=" + database + ";User_Name=" + userid + ";Password=" + password; connectionstring1 = connectionstring1 + ";SQLDialect=3;MetaDataAssemblyLoader=Borland.Data.TDBXInterbaseMetaDataCommandFactory,Borland.Data.DbxReadOnlyMetaData,Version=11.0.5000.0,Culture=neutral,"; connectionstring1 = connectionstring1 + "PublicKeyToken=91d62ebb5b0d1b1b;GetDriverFunc=getSQLDriverINTERBASE;LibraryName=dbxint30.dll;VendorLib=GDS32.DLL"; connectionstring2 = "User_Name="+userid+";Password="+password+";Database="+database+";ServerType=0;Charset=NONE;LibraryName=.\\dbxint.dll;VendorLib=GDS32.DLL;GetDriverFunc=getSQLDriverINTERBASE;SQLDialect=3"; GlobalObjects.dbconn = (TAdoDbxConnection)TAdoDbxInterBaseProviderFactory.Instance.CreateConnection(); GlobalObjects.database = databasepath; GlobalObjects.dbconn.ConnectionString = connectionstring1; //or connectionstring2 GlobalObjects.dbconn.Open();
source share