0

This is a small project for a friend where the goal is to read data from a given firebird database file and put it into MS Office 2010 Templates...so both Firebird as a database backend and .NET 4.x project type office something is the given stack.

I wrote a small (console) test app to get in touch with the firebird embedded database client, and already have the first issue I don't get rid of. My Code is as follows:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FirebirdSql.Data.FirebirdClient;

namespace TestFirebirdConnection
{
    class Program
    {
        static void Main(string[] args)
        {
            // Set the ServerType to 1 for connect to the embedded server
            string connectionString =
            "User=sysdba;" +
            "Password=******;" +
            "Database=C:\\...\\...\\...\\PDATA.FDB;" +
            "ServerType=1;" +
            "Charset=NONE;";

            try
            {
                FbConnection dbConnection = new FbConnection(connectionString);

                dbConnection.Open();

                string SQLCommandText = "select * from Patients";

                FbCommand dbCommand = new FbCommand(SQLCommandText, dbConnection);

                FbDataReader dr = dbCommand.ExecuteReader();

                while (dr.Read())  
                {
                    Console.WriteLine(dr["TITLE"] + " " + dr["SURNAME"] + " " + dr["NAME"]);

                }

                dr.Close();
                dbConnection.Close();

            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
    }
}

All works fine, the code puts out all names of a patients database on the shell. I already used the debugger to check, if the datareader and the dbConnection is closed() properly, which is the case.

After the very last line I get a nasty Windows Error Message (that kind of memory access violation) every time, where I can't find out why this is happening.

UPDATE: It seems, that it has to do with fbintl.dll

UPDATE 2: This does not happen, if I connect to a firebird server (which is unfortunately not a good solution for my light weight office template project)

Anybody knows why this is happening?

I am using:

  • Firebird ADO.NET Provider 4.6 (from NuGet)
  • Firebird Embedded database 2.5.3 x64

I actually am not sure with which version of firebird the database file was created

Jürgen Zornig
  • 1,174
  • 20
  • 48
  • 1
    And what is the exact error message? – Steve Feb 27 '15 at 22:07
  • "vshost.exe has stopped working" when I start it in VS2013 and "TestFirebirdConnection.exe has stopped working" when I run it from cmd shell. I choose to attach the debugger on it then after the crash (in VS the debugger is also crashed with it) which tells me that "Unhandled exception at 0x000000001BBE0650 (fbintl.dll) in TestFirebirdConnection.exe: 0xC0000005: Access violation reading location 0x000000001BB5DEF0." ...not very helpful for me, as I can't find anything around this issue in the net. – Jürgen Zornig Feb 27 '15 at 22:14
  • Does this happen if you connect to a Firebird server instead of using Firebird embedded? – Mark Rotteveel Feb 28 '15 at 12:12
  • No, then the application quits without the error message. Nevertheless, I want to use embedded, as this is just going to be an office template which I don't want to install firebird server on the target machine for. Is thee a chance to get this to work with embedded also? – Jürgen Zornig Feb 28 '15 at 15:06
  • 1
    capture a crash dump (full memory dump) with procdump (run procdump -ma -i C:\dumps to register procdump ast post mortem ebugger, now run your tool), download the Debug version of FB embedded extract the PDB from the zip and add the path to the PDB to Windbg settings (D:\symbols\Firebird;srv*D:\symbols\Microsoft*http://msdl.microsoft.com/download/symbols);. Now run **!analyze -v**, copy/paste the output here. – magicandre1981 Mar 01 '15 at 07:28
  • Is it fixed? If not, try firebird 2.5.4 and .net provider 4.6.2. – magicandre1981 Apr 17 '15 at 17:34
  • I have exactly the same problem. Did you fix it? – jacktric Apr 16 '18 at 10:07

0 Answers0