Connect and SourceTableName Properties Example (VC++)

This example creates a TableDef object in the specified database; sets its Connect, Name, and SourceTableName properties; and then appends it to the TableDefs collection.

CdbDBEngine      dbeng;
CdbDatabase      dbsLocal;
CdbTableDef      tdfPDXAuthor;

dbsLocal = dbeng[0L].OpenDatabase(_T("Northwind.mdb"));

tdfPDXAuthor = dbsLocal.CreateTableDef(_T("PDXAuthor"));
// Paradox table 'Author' in Database C:\PDX\Publish
tdfPDXAuthor.SetConnect(_T("Paradox 4.X;DATABASE=C:\\PDX\\PUBLISH"));
tdfPDXAuthor.SetSourceTableName(_T("Author"));
dbsLocal.TableDefs.Append(tdfPDXAuthor);

dbsLocal.Close();