Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

ADOX Tables->Append problem, C++

GrnMtn02GrnMtn02 Member Posts: 2
Hello,
I'm trying append a table the tables collection, but get this error:
Source : Microsoft JET Database Engine
description : Type is invalid.
ErrorMessage: IDispatch error #3133

Here's the code:
TESTHR(hr = m_pCatalog.CreateInstance(__uuidof (Catalog)));
m_pCatalog->Create(strcnn);
printf("Database 'c:\new.mdb' is created.
");

_TablePtr pTbl = NULL;
TablesPtr pTables = NULL;
ColumnsPtr pColumns = NULL;

TESTHR(hr = pTbl.CreateInstance(__uuidof(Table)));
pTbl->put_Name(strName);

m_pCatalog->get_Tables(&pTables);
_variant_t varTable((IUnknown *) pTbl);

pTables->Append(varTable);

Unfortunately, the MSDN page that is supposed to have a sample has only
this:
The following code demonstrates how to create a new table.

<"C:CodeADOXCreateTableX.cpp" BeginCreateTableCpp,EndCreateTableCpp>

Does anyone know where I can find more information, or perhaps an example?

TIA.


Sign In or Register to comment.