Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: ADOX question

Re: ADOX question

From: Steffen Ramlow <s.ramlow_at_gmx.de>
Date: Sat, 19 Jan 2002 16:15:15 +0100
Message-ID: <a2c2j2$1070e9$1@ID-54600.news.dfncis.de>


not all providers must support all methods, the error says that the provider cannot do this
u can "ask" the provider if it provides a method (dunno the calls now)

btw.: i would never manage DB structure via ADOX...

better use native sql

p.s.

c++ is sick :-)

"Daniel Secci" <daniel.secci_at_kriko.com> wrote in message news:a29h3r$b40$1_at_news.magnet.ch...
> Hi all,
>
> Did someone already manage to create a table with primary key
> using ADOX and OraOLEDB Provider ?
>
> The following code doesn't work (but does with SQL Server) and
> throws me an exception (the table is created without the PKey :
>
> --------------------------------------------
> // create new table
> TESTHR(table.CreateInstance(__uuidof(ADOX::Table)));
> table->PutName((LPCTSTR)(_bstr_t) newTable.bstrVal);
> table->Columns->Append("DATUM", ADOX::adDBTimeStamp, 0);
> table->Columns->Append("ZEIT", ADOX::adChar, 10);
> sprintf(pkName, "PK_%s", (LPCTSTR)(_bstr_t) newTable.bstrVal);
> // create new primary key
> TESTHR(key.CreateInstance(__uuidof(ADOX::Index)));
> key->Name = pkName;
> key->Columns->Append("DATUM", ADOX::adDBTimeStamp, 0);
> key->Columns->Append("ZEIT", ADOX::adChar, 10);
> key->PutPrimaryKey(-1);
> key->PutUnique(-1);
> key->PutIndexNulls(ADOX::adIndexNullsDisallow);
> table->Indexes->Append(_variant_t((IDispatch*) key));
> // add table
> catalog->Tables->Append(_variant_t((IDispatch *) table));
> --------------------------------------------------------------------------
>
> Exception thrown :
>
> -----------------------------------------------------------------------
> Error by adding table TAB1 : Object or provider is not capable of
performing
> requested operation.
> Error number 800a0cb3 : Unknown error 0x800A0CB3
> -----------------------------------------------------------------------
>
> Thanks,
> Daniel
>
>
Received on Sat Jan 19 2002 - 09:15:15 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US