Options

MS Access connection using ODBC from NAV 2009 R2 RTC

GabryGabry Member Posts: 48
edited 2013-09-18 in NAV Three Tier
I got successully the connection to an Access DB using ODBC provider "DSN user" using "Microsoft Access Driver (*.mdb)" driver (version 4.006305.00, ODBCJT32.DLL) on a Windows XP Professional 32-bit Platform as shown in the code below:
  SQLConnectionString := 'C:\AF\DecryptDatabase.mdb';
  ODBCConnection := ODBCConnection.OdbcConnection(SQLConnectionString);
  ODBCConnection.Open();
  ODBCCommand := ODBCConnection.CreateCommand();
  ODBCCommand.CommandText := 'select * from tablename';
  ODBCReader := ODBCCommand.ExecuteReader();

I moved exactly the same code on a Windows Server 2012 64-bit Platform using the same ODBC provider "DSN user" using "Microsoft Access Driver (*.mdb)", but with a more recent driver version (6.00).

Running the same code, it occurs the following error (see the attached picture to look at whole error message):

"The call to member Open failed: error [hy000] [Microsoft] [odbc microsoft access driver] Disk or network error"

I have already checked permissions on the database folder (now is locally to the client).

Please do you have any ideas how to solve this problem?

Comments

  • Options
    ppavukppavuk Member Posts: 334
    The database is on client, but your code is run on middle tier. That why it fails i think.
  • Options
    GabryGabry Member Posts: 48
    ppavuk wrote:
    The database is on client, but your code is run on middle tier. That why it fails i think.

    Sorry maybe that is not why it fails because I tried to allocate the same database in different machine using the LAN (changing the connection string, e.g. \\client1\databasefolder\database.mdf) and it work perfectly in the right environment. I suppose that it is different problem.

    Please do you have any other insights?

    Thank you
  • Options
    ppavukppavuk Member Posts: 334
    Maybe there is some problems with x64 ODBC provider. RTC client still 32 bit...
    No better ideas...
  • Options
    SavatageSavatage Member Posts: 7,142
    I don't know if this is helpful but I had a 64 bit machine and finally got my odbc to work but I had to access the 32bit administrator tool instread of the 64 bit to get it work work properly.

    http://support.microsoft.com/kb/942976

    Odbcad32.exe
Sign In or Register to comment.