.net provider to geodatabase fails when run from windows service

1412
1
11-14-2011 07:59 AM
BruceCheney
New Contributor
For a variety of operations we load geodatabase layer tables into .net datasets as datatables.  We use the data providers from esri to make this connection.  The connection is as follows:

  projConn = New OleDb.OleDbConnection("Provider=ESRI.GeoDB.OleDB.1;Data Source=" & daPath & ";Extended Properties=workspacetype=esriDataSourcesGDB.FileGDBWorkspaceFactory.1;Geometry=WKB")

And then to fill the dataset:

layDAdbf = New OleDb.OleDbDataAdapter
layDAdbf.FillSchema(daDataset, SchemaType.Mapped, layername)
layDAdbf.Fill(daDataset, layername)

This has worked for many years in a variety of product usages.  We are now trying to use this from a Windows Service.  It works in a console app, a scheduled task but not in a windows service.  It always fails on the fill statement.   With a File Geodatabase the program just ends - no error reporting even with a try-catch.  The Windows event viewer reports the following:

Faulting module name: ntdll.dll, version: 6.1.7600.16695, time stamp: 0x4cc7ab86
Exception code: 0xc0000005

There appears to be many possible causes for this exception. Does anyone have any comments or suggestions - have you run into this issue.

Any help is greatly appreciated.
0 Kudos
1 Reply
AlexMerkulov
New Contributor II

Is your service run on x64? If yes you got an "The 'ESRI.GeoDB.OLEDB.1' provider is not registered on the local machine" exception.

0 Kudos