Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

OLEDB Data Provider Development

Posted on 2002-04-18
1
Medium Priority
?
289 Views
Last Modified: 2013-12-03
I am developing OGC data provider component(Data Provider component which satisfies OPEN GIS Simple Feature Spec., so that can handles geometry data.) using ATL Provider template library.
I want to support ITableDefinition interface, especially CreateTable method.
The CreateTable method requires Column Properties to define columns of a table(especially geometry column).

So, I

1. define custom Column Property set  in .h file as follows (to give an ability to data provider defining geometry column to table):

DEFINE_GUID(DBPROPSET_OGIS_COLUMN, ...);

#define OGIS_PROPERTY_SET 0x1000L

enum DBPROPOGISENUM {
 DBPROP_OGIS_GEOM_TYPE = OGIS_PROPERTY_SET + 128,
 DBPROP_OGIS_EXTENT_MINX = OGIS_PROPERTY_SET + 129,
 ...
};

2. add property string to data provider's .rc file as follows :

Property      : OGIS_GEOM_TYPE
Property Constant ID  : PROP_OGIS_GEOM_TYPE
Property String Table ID  : IDS_PROP_OGIS_GEOM_TYPE
Property Description : “Geom type”
...

3. and add property set map to session object(or Data Source Object, which is right?) as follows :

...
BEGIN_PROPERTY_SET(DBPROPSET_OGIS_COLUMN)
    PROPERTY_INFO_ENTRY_EX(OGIS_GEOM_TYPE, VT_UI4, DBPROPFLAGS_COLUMN|DBPROPFLAGS_READ|   DBPROPFLAGS_WRITE, 1, 0)
...
    PROPERTY_INFO_ENTRY_EX(OGIS_EXTENT_MAXX, VT_R8, DBPROPFLAGS_COLUMN | DBPROPFLAGS_READ| DBPROPFLAGS_WRITE, 1, 0)
END_PROPERTY_SET(DBPROPSET_OGIS_COLUMN)
...


But, In VB test application, the newly defined properties(Geom type, ... etc) does not appear.... T.T

Dim conn As ADODB.Connection
 
Set conn = New ADODB.Connection
   
connStr = "Provider=..."
   
conn.Open connStr

For Each prp In conn.Properties
      Debug.Print prp.Name, prp.Value
Next prp

=====================================================================================
Sorry for my poor English ^^;

Did anyone ever have this problem before? or Any clues?

Thanks a lot in advance.
0
Comment
Question by:choisk
1 Comment
 
LVL 2

Accepted Solution

by:
SChertkov earned 900 total points
ID: 6979679
After init you provider in IDBInitialize::Initialize
ADO request properties IDBProperties::GetPropertyInfo
ONLY in categories DBPROPSET_DATASOURCEALL, DBPROPSET_DATASOURCEINFOALL, DBPROPSET_DBINITALL,
DBPROPSET_SESSIONALL.
Relationship between special GUID and you properties
GUID hardcoded in ATL. Therefore VB not show
any custom property set in connection properties
in ATL providers.

Next, i think that you must define you property
set in Rowset and Command, not in DataSource object, because column properties supported OLE DB in
command and rowsets. Also, you can try to define you properties direct in DBPROPSET_ROWSET where appropriate.


Sorry my english too.
Semyon.
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question