|
急!!(evc4.0+ado3.1)create database 不成功
[复制链接]
程序段如下:
hr=CLSIDFromProgID(g_szADOCE30ConnProgID,&tClsid);
hr= CoCreateInstance(tClsid,NULL,CLSCTX_INPROC_SERVER|CLSCTX_LOCAL_SERVER,IID_Connection,(LPVOID*)&m_pADOCEConn);
hr=m_pADOCEConn->put_Provider(TEXT("cedb"));
hr=CLSIDFromProgID(g_szADOCE30RSProgID,&tClsid);
hr= CoCreateInstance(tClsid,NULL,CLSCTX_INPROC_SERVER|CLSCTX_LOCAL_SERVER,IID_Recordset,(LPVOID*)&m_pADOCERS); //以上都已成功
wcscpy(szSqlBuf,_T("CREATE DATABASE'\test.cdb'"));
VariantInit(&varTSQL);
VariantInit(&varEmpty);
varTSQL.bstrVal = SysAllocString(szSqlBuf);
varTSQL.vt = VT_BSTR;
hr=m_pADOCERS->Open(varTSQL, varEmpty, MSADOCE::adOpenDynamic,MSADOCE::adLockOptimistic,MSADOCE::adCmdText);
//此处create database失败
不知道哪里出错,忘指教!!!
|
|