Click here to Skip to main content
15,890,438 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to get the handle of a Popup Menu for a window? Pin
Xiangyang Liu 刘向阳25-Jan-06 13:56
Xiangyang Liu 刘向阳25-Jan-06 13:56 
AnswerRe: How to get the handle of a Popup Menu for a window? Pin
Hans Ruck24-Jan-06 22:30
Hans Ruck24-Jan-06 22:30 
QuestionMRU in a popup submenu Pin
manosza24-Jan-06 9:17
manosza24-Jan-06 9:17 
QuestionPassword protect a document Pin
arnoldkempt24-Jan-06 8:41
arnoldkempt24-Jan-06 8:41 
AnswerRe: Password protect a document Pin
Maximilien24-Jan-06 8:47
Maximilien24-Jan-06 8:47 
GeneralRe: Password protect a document Pin
arnoldkempt25-Jan-06 7:27
arnoldkempt25-Jan-06 7:27 
AnswerRe: Password protect a document Pin
sps-itsec4624-Jan-06 12:56
sps-itsec4624-Jan-06 12:56 
QuestionMS Access ODBC Compact and Repair Pin
Anfernius24-Jan-06 6:20
Anfernius24-Jan-06 6:20 
Is it possible using plain C to compact and repair a MS Access Database trough ODBC?

I'm trying the following code, found it in the WEB:

void CompactAndRepairDB ()<br />
{<br />
	RETCODE retcode;<br />
	int     subscrp;<br />
<br />
	CHAR szDriver[]			= "Microsoft Access Driver (*.mdb)";<br />
	CHAR *szAttributes2[]	=<br />
								// Create the original .mdb file.<br />
								{"REPAIR_DB=db.mdb\0\0",<br />
<br />
								// Compact the file onto itself.<br />
								"COMPACT_DB=db.mdb db2.mdb General\0\0"};<br />
<br />
	for (subscrp = 0; subscrp <= ((sizeof szAttributes2 / sizeof(UCHAR *)) - 1); subscrp++)<br />
	{<br />
		retcode = SQLConfigDataSource (NULL, ODBC_ADD_DSN, szDriver, szAttributes2[subscrp]);<br />
		if (retcode != TRUE)<br />
		{<br />
			for(int i=1;i<=8;i++)<br />
			{<br />
				DWORD dwcode = NULL;<br />
				WORD wlen = 0;<br />
				char szerr[SQL_MAX_MESSAGE_LENGTH] = {0};<br />
				if (SQLInstallerError((WORD)i, &dwcode, szerr, SQL_MAX_MESSAGE_LENGTH-1, &wlen) == SQL_SUCCESS)<br />
					printf ("Code: %u %s\n",dwcode,szerr);<br />
			}<br />
		}<br />
	}<br />
}


After creating the new compacted file I copy it over the old file.

Though when I run the compacting program I get the following error:

Driver's ConfigDSN, ConfigDriver, or ConfigTranslator failed.

I'm not using an ODBC datasource, only using filenames.

Thanks in advance,

Anfernius

-- modified at 12:21 Tuesday 24th January, 2006
QuestionWTF: std::string.find_first_of woes Pin
Sebastian Schneider24-Jan-06 5:25
Sebastian Schneider24-Jan-06 5:25 
AnswerRe: WTF: std::string.find_first_of woes Pin
Christian Graus24-Jan-06 14:20
protectorChristian Graus24-Jan-06 14:20 
GeneralRe: WTF: std::string.find_first_of woes Pin
Sebastian Schneider25-Jan-06 2:07
Sebastian Schneider25-Jan-06 2:07 
Question__gc* equivalent in VC++ 2005 Pin
madhusri24-Jan-06 4:32
madhusri24-Jan-06 4:32 
AnswerRe: __gc* equivalent in VC++ 2005 Pin
toxcct24-Jan-06 4:34
toxcct24-Jan-06 4:34 
GeneralRe: __gc* equivalent in VC++ 2005 Pin
madhusri24-Jan-06 4:44
madhusri24-Jan-06 4:44 
GeneralRe: __gc* equivalent in VC++ 2005 Pin
Christian Graus24-Jan-06 14:34
protectorChristian Graus24-Jan-06 14:34 
GeneralRe: __gc* equivalent in VC++ 2005 Pin
Ryan Binns24-Jan-06 17:59
Ryan Binns24-Jan-06 17:59 
QuestionHello Pin
nne-vitamin24-Jan-06 4:06
nne-vitamin24-Jan-06 4:06 
AnswerRe: Hello Pin
toxcct24-Jan-06 4:32
toxcct24-Jan-06 4:32 
GeneralRe: Hello Pin
nne-vitamin24-Jan-06 4:42
nne-vitamin24-Jan-06 4:42 
GeneralRe: Hello Pin
toxcct24-Jan-06 4:45
toxcct24-Jan-06 4:45 
GeneralRe: Hello Pin
nne-vitamin24-Jan-06 5:00
nne-vitamin24-Jan-06 5:00 
GeneralRe: Hello Pin
toxcct24-Jan-06 5:03
toxcct24-Jan-06 5:03 
GeneralRe: Hello Pin
nne-vitamin24-Jan-06 5:12
nne-vitamin24-Jan-06 5:12 
GeneralRe: Hello Pin
toxcct24-Jan-06 5:15
toxcct24-Jan-06 5:15 
GeneralRe: Hello Pin
nne-vitamin24-Jan-06 5:23
nne-vitamin24-Jan-06 5:23 

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.