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: Daniel Secci <daniel.secci_at_kriko.com>
Date: Mon, 21 Jan 2002 09:11:12 +0100
Message-ID: <a2ghsf$62b$1@news.magnet.ch>


Thanks Steffen.

The problem is I have to write an application which works with several DBMS (mainly SQL Server / Oracle and Access). I have to dynamically create tables, that's why I use ADOX. The piece of code works with SQL Server but not with Oracle. I really have to find a way...

Daniel

"Steffen Ramlow" <s.ramlow_at_gmx.de> schrieb im Newsbeitrag news:a2c2j2$1070e9$1_at_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 Mon Jan 21 2002 - 02:11:12 CST

Original text of this message

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