Click here to Skip to main content
15,886,919 members
Home / Discussions / Database
   

Database

 
GeneralAuto Translate=False problem Pin
saglam29-Apr-04 5:38
saglam29-Apr-04 5:38 
GeneralRe: Auto Translate=False problem Pin
Mike Dimmick4-May-04 23:04
Mike Dimmick4-May-04 23:04 
GeneralRe: Auto Translate=False problem Pin
saglam10-May-04 8:38
saglam10-May-04 8:38 
GeneralRe: Auto Translate=False problem Pin
Mike Dimmick10-May-04 9:49
Mike Dimmick10-May-04 9:49 
GeneralSQL Pin
Boycech29-Apr-04 4:56
Boycech29-Apr-04 4:56 
GeneralRe: SQL Pin
Mike Ellison30-Apr-04 5:44
Mike Ellison30-Apr-04 5:44 
GeneralRe: SQL Pin
Boycech30-Apr-04 5:46
Boycech30-Apr-04 5:46 
GeneralRe: SQL Pin
Bill Dean4-May-04 5:04
Bill Dean4-May-04 5:04 
GeneralRe: SQL Pin
Boycech4-May-04 5:18
Boycech4-May-04 5:18 
GeneralRe: SQL Pin
talamar10-May-04 15:46
talamar10-May-04 15:46 
GeneralCreate an Access Database at runtime Pin
bsargos29-Apr-04 4:55
bsargos29-Apr-04 4:55 
GeneralRe: Create an Access Database at runtime Pin
BadJerry29-Apr-04 5:13
BadJerry29-Apr-04 5:13 
GeneralRe: Create an Access Database at runtime Pin
Santanu Lahiri29-Apr-04 10:24
Santanu Lahiri29-Apr-04 10:24 
GeneralRe: Create an Access Database at runtime Pin
Santanu Lahiri30-Apr-04 5:55
Santanu Lahiri30-Apr-04 5:55 
This seems to work fine with an abbreviated Connection string.
You can not use the full-blown connection string.

I just tested it and it created the database successfully. Probably not the most efficient error reporting, but that you can modify to suit your needs.

The CADOXCatalog comes from Carlos Antollini's ADOX class available on CodeProject website.

------------------------------------------------------------------------
CString sConnectionString = _T("Provider='Microsoft.Jet.OLEDB.4.0';Data Source='%s'");
CString sMsg;
try
{
CADOXCatalog cat;
CString sConnect;
sConnect.Format (sConnectionString, sDBName);
cat.m_pCatalog->Create(_bstr_t((LPCTSTR) sConnect));
sMsg.Format (_T("Database %s created successfully"), sDBName);
}
catch (_com_error& e)
{
TCHAR szBuf[300];
// Notify the user of errors if any.
_bstr_t bstrSource(e.Source());
_bstr_t bstrDescription(e.Description());
sprintf(szBuf, "Source : %s\nDescription : %s", (LPCSTR)bstrSource,(LPCSTR)bstrDescription);
CString sErr = CString (szBuf);
sMsg.Format (_T("Can not create database %s\n%s\n%s"), sCmd, CString (e.ErrorMessage()), sErr);
}
AfxMessageBox (sMsg);

GeneralSage Accounting Version 10 Pin
Kryptos Sol29-Apr-04 4:43
Kryptos Sol29-Apr-04 4:43 
Generalexec two stored procedure in a main stored procedure Pin
manasrahfantom29-Apr-04 2:27
manasrahfantom29-Apr-04 2:27 
GeneralRe: exec two stored procedure in a main stored procedure Pin
Jeff Varszegi29-Apr-04 3:11
professionalJeff Varszegi29-Apr-04 3:11 
GeneralRe: exec two stored procedure in a main stored procedure Pin
manasrahfantom30-Apr-04 21:33
manasrahfantom30-Apr-04 21:33 
GeneralRe: exec two stored procedure in a main stored procedure Pin
Jeff Varszegi1-May-04 6:49
professionalJeff Varszegi1-May-04 6:49 
GeneralADO.NET Deletion from SQL DB problem. Pin
Member 105947128-Apr-04 19:52
Member 105947128-Apr-04 19:52 
GeneralTransferring Data Pin
ibok2328-Apr-04 5:40
ibok2328-Apr-04 5:40 
Generalcheck login exists Pin
Dpriya28-Apr-04 2:50
Dpriya28-Apr-04 2:50 
GeneralRe: check login exists Pin
Mazdak28-Apr-04 3:47
Mazdak28-Apr-04 3:47 
GeneralRe: check login exists Pin
Jeff Martin28-Apr-04 5:33
Jeff Martin28-Apr-04 5:33 
GeneralRe: check login exists Pin
Jeff Martin28-Apr-04 5:32
Jeff Martin28-Apr-04 5:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.