Can't open the personal feature layer with X64 platform

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Can't open the personal feature layer with X64 platform

casper
Hi Supporters,
I try to open a .mdb file with fdo personal feature layer on X64 platform,
but it is failed. If I run it on X86 platform, it runs successful. I don't
know how to make it correct.

Following statements are my test code:

var providerName = "OSGeo.OGR";
var connectionString = string.Format(@"DataSource={0};ReadOnly=TRUE",
@"C:\test\WinForms App2\WinForms App2\AppData\Portsmouth_2000.mdb");
var featureClassName = "ContactLn";
var idColumnName = "FeatGUID";
var fdoConnection =
FeatureAccessManager.GetConnectionManager().CreateConnection(providerName);
fdoConnection.ConnectionString = connectionString;
fdoConnection.Open();

An exception has been thrown :

An unhandled exception of type 'OSGeo.FDO.Common.Exception' occurred in
OSGeo.FDO.dll
Additional information: Connect failed: Unable to initialize ODBC connection
to DSN for DRIVER=Microsoft Access Driver (*.mdb);DBQ=C:\test\Map Suite
Desktop for WinForms App2\Map Suite Desktop for WinForms
App2\AppData\Portsmouth_2000.mdb,
[Microsoft][ODBC Driver Manager] Data source name not found and no default
driver specified

Now, on my computer environment:
OS: windows 10 Enterprise X64
Office version: Office 2013 X86
Office Access Engine: Microsoft Access Database Engine 2010 Redistributable
X64.

I appreciate for your any help.

Thanks,
Casper. Lee



--
Sent from: http://osgeo-org.1560.x6.nabble.com/FDO-Users-f3898664.html
_______________________________________________
fdo-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

Re: Can't open the personal feature layer with X64 platform

Jackie Ng
Use:

Driver={Microsoft Access Driver (*.mdb, *.accdb)}

For 64-bit.

Long ancient blog post of mine about this:
http://themapguyde.blogspot.com.au/2010/07/connecting-to-ms-access-databases-with.html

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/FDO-Users-f3898664.html
_______________________________________________
fdo-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

After modify the connection string, another exception thrown

casper
This post was updated on .
Hi Jackie,

Thanks for your information.

I have updated our code as your advice. The new connections string is "Driver={Microsoft Access Driver (*.mdb, *.accdb)};Dbq= filePath". But not luck, we still cannot open this .mdb file when using “x64” FDO. It displays one new exception:
"Missing required DataStore property", please refer the snapshot
<http://osgeo-org.1560.x6.nabble.com/file/t377277/anotherException.png

We created one sample to help you recreate this issue, please refer  https://drive.google.com/file/d/1cq7bX8pgXpgnbu7enfwVrEageK4oif14/view

If you need any more information, please let me know that.

Thanks,
Casper. Lee



--
Sent from: http://osgeo-org.1560.x6.nabble.com/FDO-Users-f3898664.html
_______________________________________________
fdo-users mailing list
fdo-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

Re: Can't open the personal feature layer with X64 platform

casper
In reply to this post by Jackie Ng
Hi Jackie,
Do you have any updates on this issue? I have sent a sample for recreating
this issue. I'm appreciate to your more help.

Thanks,
Casper. Lee



--
Sent from: http://osgeo-org.1560.x6.nabble.com/FDO-Users-f3898664.html
_______________________________________________
fdo-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

Re: Can't open the personal feature layer with X64 platform

Hans Milling
Make sure the 64 bit access driver is installed on the machine:
https://www.microsoft.com/en-us/download/details.aspx?id=13255
(If you have ANY 32 bit office component, you have to entirely remove
Office. Install 64 bit driver and install Office again).

Also try this connection string instead:
Provider="Microsoft.ACE.OLEDB.12.0";Data Source="c:\my\database.mdb";



--
Sent from: http://osgeo-org.1560.x6.nabble.com/FDO-Users-f3898664.html
_______________________________________________
fdo-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

Re: Can't open the personal feature layer with X64 platform

casper
Hi Hans,
Thanks for your advice. I tried to install "Microsoft Access Database Engine
2010 Redistributable" on a Win10 x64 platform without any office, but it
still didn't work and thrown an exception "Missing required DataStore
property" as following snapshot:
<http://osgeo-org.1560.x6.nabble.com/file/t377277/WithoutOfficeX64.png>

I also changed the connection string with
"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=", but it still didn't work
and thrown an exception "Missing required DataStore property" as following
snapshot:
<http://osgeo-org.1560.x6.nabble.com/file/t377277/WithOleDb.png>

Do you have another advice to help me? I'm very appreciate for your help.

Thanks,
Casper. Lee



--
Sent from: http://osgeo-org.1560.x6.nabble.com/FDO-Users-f3898664.html
_______________________________________________
fdo-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

Re: Can't open the personal feature layer with X64 platform

Hans Milling
Try to remove the ConnectionString property and add this:
           
fdoConnection.ConnectionInfo.ConnectionProperties.SetProperty("DataSource",
@"C:\MyDatabases\database.mdb");

Note that the name is DataSource and not DataStore.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/FDO-Users-f3898664.html
_______________________________________________
fdo-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

Re: Can't open the personal feature layer with X64 platform

casper
This post was updated on .
Hi Hans,

Thanks for your help. I have tried to set the "DataSource" property as your
mentions, but a "Connect failed" exception has been thrown as following
snapshot:
<http://osgeo-org.1560.x6.nabble.com/file/t377277/ConnectFailed.png

Following steps are my operations:
1. Make sure without any office version on my computer.
2. OS: Win10 Enterprise x64.
3. The "Microsoft Access Database Engine 2010 Redistributable" x64 has been
installed on my computer as following snapshot:
<http://osgeo-org.1560.x6.nabble.com/file/t377277/AccessX64.png
4. Open the fdo connection as following statements:

var pathFilename = @"data\JORWD6gdb.mdb";
var providerName = "OSGeo.OGR";
var fdoConnection =
FeatureAccessManager.GetConnectionManager().CreateConnection(providerName);
fdoConnection.ConnectionInfo.ConnectionProperties.SetProperty("DataSource",
pathFilename);
fdoConnection.Open();

5. Compile the application with x64 platform.

6. Run the application, the exception has been thrown:

Connect failed: Unable to initialize ODBC connection to DSN for
DRIVER=Microsoft Access Driver (*.mdb);DBQ=data\JORWD6gdb.mdb,
[Microsoft][ODBC Driver Manager] Data source name not found and no default
driver specified

7. I have tried to set the property to "DataSource" and "Data Source", but the exception is still exist.

I haven't any idea on this issue. Do you have another advice to help me? I'm
very appreciate for your help.

Thanks,
Casper. Lee



--
Sent from: http://osgeo-org.1560.x6.nabble.com/FDO-Users-f3898664.html
_______________________________________________
fdo-users mailing list
fdo-users@lists.osgeo.org
https://lists.osgeo.org/mailman/listinfo/fdo-users
Reply | Threaded
Open this post in threaded view
|

Re: Can't open the personal feature layer with X64 platform

Jackie Ng
I think you need to set the PGEO_DRIVER_TEMPLATE environment variable first
to force a 64-bit driver name in its data source construction, you create an
OGR connection to your pgdb.

References:

   https://trac.osgeo.org/gdal/ticket/5594
   https://issues.qgis.org/issues/12054

- Jackie



--
Sent from: http://osgeo-org.1560.x6.nabble.com/FDO-Users-f3898664.html
_______________________________________________
fdo-users mailing list
[hidden email]
https://lists.osgeo.org/mailman/listinfo/fdo-users