void OpenSchemaX(TCHAR *TableName)
{
HRESULT hr = S_OK;
::CoInitialize(NULL); //初始化Com
IADORecordBinding *picRs = NULL;
_RecordsetPtr pRstSchema("ADODB.Recordset");
_ConnectionPtr pConnection("ADODB.Connection" );
pConnection-ConnectionString = TableName;
pConnection-Provider = "Microsoft.Jet.OLEDB.4.0";
try
{
pConnection-Open(pConnection-ConnectionString, "", "", adModeUnknown);
pRstSchema-QueryInterface(
__uuidof(IADORecordBinding), (LPVOID*)&picRs);
pRstSchema =...[ 查看全文 ]