Best way to connect to Interbase 7.1 using .NET C #

Can someone explain the best way to connect to Interbase 7.1 database using .NET / C #?

The application will be installed on many end-user computers, so the fewer add-ons I have to pack with my application, the better.

+4
source share
4 answers

CodeGear offers a free ADO.NET 2.0 driver for registered InterBase users here:

http://cc.embarcadero.com/item/25497

Please note that “registered InterBase users” include the free version of InterBase 2007 Developers Edition. The download says it's 2007, but it works great with InterBase 7, and the InterBase team at CodeGear told me that they have no problems with people using it for this purpose.

I do not recommend using a driver designed for Firebird, as InterBase and Firebird have slightly different SQL syntaxes and differ in other functions. In particular, I believe that using any driver dependent on fbclient.dll with InterBase is absolutely dangerous.

+4
source

I think the Firebird.net provider is the same as the one in mono. Both are great by the way.

0
source

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(); 
0
source

All Articles