Select to view content in your preferred language

VersionedWorkspace without ArcSDE ?

4412
6
Jump to solution
01-20-2015 04:51 AM
MatthiasWanschura
Deactivated User

Dear community,

In our ArcGIS Engine application, we use the SdeWorkspaceFactory to open a Workspace to a versioned enterprise geodatabase.

A VersionedWorkspace object can be created from such a wokspace and it works fine.

Now that ArcGIS 10.3 no longer contains ArcSDE, I assume that I cannot use the SdeWorkspaceFactory any more to connect to a 10.3 geodatabase.

But when I try the SqlWorkspaceFactory instead, the returned Workspace does not support the VersionedWorkspace methods.

Example:

AutomationException: 0x80004002 - No such interface supported   
at com.esri.arcgis.geodatabase.VersionedWorkspace.getVersionName(Unknown

So my question is: How can I create a VersionedWorkspace object via ArcGIS Engine in 10.3 ?

Regards,

Matthias Wanschura

0 Kudos
1 Solution

Accepted Solutions
ModyBuchbinder
Esri Regular Contributor

Hi

Try reverse engineering.

After you confirm the name and user (just once) run code that gets IWorkspace.ConnectionProperties Check the values of the result propertieySet to find what is wrong with yours.

Have fun

View solution in original post

6 Replies
ModyBuchbinder
Esri Regular Contributor

Hi

ArcGIS 10.3 contain ArcSDE just like any other version. It is just not a service and you must use direct connect.

Other than that all your 10.2 code should work.

Have Fun

Mody

0 Kudos
MatthiasWanschura
Deactivated User

Hi Mody,

thanks for your reply!

So if I understand correctly, I can still use SdeWorkspaceFactory without having an SDE Service.

What do I need instead? Just a 10.3 geodatabase and ArcGIS Engine?

Do you have an example for the connection parameters for direct connect in this case?

Matthias

0 Kudos
ModyBuchbinder
Esri Regular Contributor
MatthiasWanschura
Deactivated User

Hi Mody,

partial success: The direct connection works, but I can't get rid of the connection dialog that pops up, although I
think that all the parameters are correctly specified. It seems that the USER Parameter is not recognized.

Parameters (I am using the ArcObjects JAVA API):

ps.setProperty("USER","sa");

ps.setProperty("PASSWORD","xxxxxx");

ps.setProperty("DBCLIENT", "SQLServer");

ps.setProperty("DATABASE_CONNECTION_PROPERTIES",

"Data
Source=10.3.7.118\\testGeoInstance;Initial Catalog=GeoDB;"
);

ps.setProperty("AUTHENTICATION_MODE", "DBMS");

ps.setProperty("VERSION","sde.DEFAULT");

 

In the connection dialog that pops up, ONLY the SQlServer platform is
correctly pre-populated.

When I skip the user parameter:

//ps.setProperty("USER","sa");

ps.setProperty("PASSWORD","xxxxxx");

ps.setProperty("DBCLIENT", "SQLServer");

ps.setProperty("DATABASE_CONNECTION_PROPERTIES",

"Data
Source=10.3.7.118\\testGeoInstance;Initial Catalog=GeoDB;"
);

ps.setProperty("AUTHENTICATION_MODE", "DBMS");

ps.setProperty("VERSION","sde.DEFAULT");

Then all is correctly pre-populated in the dialog and the user name is (I guess) taken from the last successful login, but
needs to be confirmed.
When I click ok, the connection can be created. But I need a way to specify the user programmatically. Do you have an
idea what is wrong?

I also tried to specify user name and password in the DATABASE_CONNECTION_PROPERTIES
connection string, but that didn’t help (although I tested the connection string successfully in a pure Sql client test).

At the page you suggested there is also an example how to suppress the login dialog in case of incomplete or incorrect
parameters, but it didn’t work, the popup still appears. And that example looks strange, the connection is created twice…

Matthias

0 Kudos
ModyBuchbinder
Esri Regular Contributor

Hi

Try reverse engineering.

After you confirm the name and user (just once) run code that gets IWorkspace.ConnectionProperties Check the values of the result propertieySet to find what is wrong with yours.

Have fun

MatthiasWanschura
Deactivated User

Hi,

thanks, that helped!

The solution was: The INSTANCE Parameter needs to have this form:

"sde:sqlserver:10.3.7.118\testGeoInstance"

Although the documentation says that this parameter is just there for legacy reasons and no longer needed....

0 Kudos