Click here to Skip to main content
15,913,212 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Subclassing problem: WM_LBUTTONDOWN is missing Pin
Axonn Echysttas25-Jan-06 0:16
Axonn Echysttas25-Jan-06 0:16 
GeneralRe: Subclassing problem: WM_LBUTTONDOWN is missing Pin
Ryan Binns25-Jan-06 0:18
Ryan Binns25-Jan-06 0:18 
GeneralRe: Subclassing problem: WM_LBUTTONDOWN is missing Pin
Axonn Echysttas25-Jan-06 0:22
Axonn Echysttas25-Jan-06 0:22 
QuestionManifest == dud ? Pin
Swinefeaster24-Jan-06 11:47
Swinefeaster24-Jan-06 11:47 
AnswerRe: Manifest == dud ? Pin
Christian Graus24-Jan-06 14:14
protectorChristian Graus24-Jan-06 14:14 
GeneralRe: Manifest == dud ? Pin
S Douglas24-Jan-06 20:37
professionalS Douglas24-Jan-06 20:37 
GeneralRe: Manifest == dud ? Pin
Swinefeaster25-Jan-06 15:26
Swinefeaster25-Jan-06 15:26 
QuestionErase Window Pin
sidkraft24-Jan-06 11:39
sidkraft24-Jan-06 11:39 
AnswerRe: Erase Window Pin
Christian Graus24-Jan-06 14:16
protectorChristian Graus24-Jan-06 14:16 
QuestionHow to get the handle of a Popup Menu for a window? Pin
Xiangyang Liu 刘向阳24-Jan-06 9:38
Xiangyang Liu 刘向阳24-Jan-06 9:38 
AnswerRe: How to get the handle of a Popup Menu for a window? Pin
Laxman924-Jan-06 17:33
Laxman924-Jan-06 17:33 
AnswerRe: How to get the handle of a Popup Menu for a window? Pin
Ryan Binns24-Jan-06 17:58
Ryan Binns24-Jan-06 17:58 
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 

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.