Select to view content in your preferred language

Query FGDB

3115
8
Jump to solution
01-29-2012 01:35 AM
OlivierOlivier
Regular Contributor
Hi,

I would like to query a file geodatabase, mainly with SQL Queries applied to tables (I could use Python to query features if I need).

1) I first tried to use VB.NET Oldebdconnection but get the message "The Product License has not been initialized." How can I initialize it ? Is it really free ? I saw other threads in this forum and it doesn't appear very clear.

2) As I want to apply only SQL Queries, should I use API ? I saw that there is a wrapper for VB.net but I don't understand how to makes it works, could someone be so kind to add a short VB .net example ?

Thanks very much,

Olivier
0 Kudos
1 Solution

Accepted Solutions
VinceAngelo
Esri Esteemed Contributor
Yes, it's certainly possible, but a search on "custom ODBC driver" indicates it would likely be
exceedingly difficult to write one from scratch, even for a team of seasoned C/C++ developers
(and that doesn't even consider how you'd model the spatial component in an interface that
doesn't contemplate spatial data).

- V

View solution in original post

0 Kudos
8 Replies
VinceAngelo
Esri Esteemed Contributor
That "license has not been initialized" message is generated by ArcObjects.  This forum is for the
File Geodatabase API, which has an independent code tree from ArcObjects (and really is free).

If you have ArcGIS, you should probably use ArcObjects (or Python) to access file geodatabases
(nothing extra to install; you just need to use the programming interface correctly [checking out
a license
at the top of your code]).

- V
0 Kudos
OlivierOlivier
Regular Contributor
Hi Vince,

Thanks for your answer. I'm interested in using the FGDB API as I have an existing software that applies SQL Queries. My problem is that it's written in VB .net, I read that there was a wrapper to use API with VB.net but I don't find any example in the downloaded 1.1 API or elsewhere. If possible, I would appreciate any tiny example to get in.

Olivieir.
0 Kudos
VinceAngelo
Esri Esteemed Contributor
The .NET wrapper is a part of the VS2010 API release (only).  Which did you download?

- V
0 Kudos
OlivierOlivier
Regular Contributor
I downloaded "FileGDB_API_VS2010_1_1.zip" and went thru but didn't find a sample about Vb .net. Of course I'll try by myself but if I can save time in order to find the very few first references/declarations, I would appreciate.
0 Kudos
DavidSousa
Occasional Contributor
The samples for the .NET wrapper are written in C#.  At this time, there are no samples for VB.NET.  I think that you will find that referring to the C# samples should be sufficiently instructive to help you write VB code.
0 Kudos
OlivierOlivier
Regular Contributor
Hi,

So I translated from C# to VB, that's ok. As I have a running program that is connected with different databases (not only geo...), I wanted to know if it will be possible to connect to a FGDB with ODBC ?
I saw that the question has been asked several times, and saw only one answer that said that it was possible to build one with the API, which I'm not able to evaluate complexity level.

Thanks

Olivier
0 Kudos
VinceAngelo
Esri Esteemed Contributor
Yes, it's certainly possible, but a search on "custom ODBC driver" indicates it would likely be
exceedingly difficult to write one from scratch, even for a team of seasoned C/C++ developers
(and that doesn't even consider how you'd model the spatial component in an interface that
doesn't contemplate spatial data).

- V
0 Kudos
OlivierOlivier
Regular Contributor
Ok, thanks for your answer Vince, perhaps Esri will add one later, that's my only hope...

Olivier
0 Kudos