Click here to Skip to main content
15,925,181 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: I dont ask so bigger thing ! I want only simple and little thing ! So Why I in troubles ???????? Pin
mimi14-Oct-01 16:04
mimi14-Oct-01 16:04 
GeneralRe: I dont ask so bigger thing ! I want only simple and little thing ! So Why I in troubles ???????? Pin
Rashid Thadha14-Oct-01 22:32
Rashid Thadha14-Oct-01 22:32 
GeneralADOX Create database file Pin
Christian Graus13-Oct-01 23:17
protectorChristian Graus13-Oct-01 23:17 
GeneralRe: ADOX Create database file Pin
Anders Molin14-Oct-01 1:48
professionalAnders Molin14-Oct-01 1:48 
GeneralRe: ADOX Create database file Pin
Christian Graus14-Oct-01 2:04
protectorChristian Graus14-Oct-01 2:04 
GeneralRe: ADOX Create database file Pin
Anders Molin14-Oct-01 4:15
professionalAnders Molin14-Oct-01 4:15 
GeneralRe: ADOX Create database file Pin
Christian Graus14-Oct-01 2:09
protectorChristian Graus14-Oct-01 2:09 
GeneralRe: ADOX Create database file Pin
Christian Graus14-Oct-01 2:39
protectorChristian Graus14-Oct-01 2:39 
The specific problem now is when I try to add data:

// Get everything in order first
if (records->RecordCount != 0)
	records->MoveFirst();
CComBSTR bstrPath;
(*it)->get_FilePath(&bstrPath);

char * pStr = new char[bstrPath.Length() + 24]; 
memset(pStr, 0, bstrPath.Length() + 24); 
sprintf(pStr, "[FilePath] = \'%s\'", (char*)(_bstr_t)bstrPath);

try
{
	records->Filter = (bstr_t)pStr;
}
catch (.../*_com_error & e*/)
{
	MessageBox(NULL, "Error", pStr, 0);
}

string renderpath = (bstr_t)bstrPath;

for (string::iterator itr = renderpath.begin(); itr != renderpath.end(); ++itr)
	 if (*itr == '?') *itr = '\'';

// Call our connection point to inform of file name we are about to scan
CComBSTR callback(renderpath.c_str());
Fire_ScanningFile(callback);

if (records->RecordCount == 0)
{


The above code opens the recordset, moves to the start if it has records, replaces ? with ' in the filename ( having ' in my records killed my query statements ), sends a callback and then checks if the record count is 0 after the filter, which means I should add the record. Now if I create the DB programatically, this code always falls through, and records->RecordCount ALWAYS equals 1 ( tried with zero, one and two records in the DB. The odd thing is that everything is fine in Access, I can add & remove records, and they show OK in my program. The *other* odd thing is if I called Records->MoveFirst() when there were zero recordsin the DB created in Access it would crash, unless it crashes if it finds zero for no REAL reason, and for some reason it's finding one, which is OK.

Argh !!!!!


Christian

As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.

Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
GeneralRe: ADOX Create database file Pin
Wanderley M14-Oct-01 3:55
Wanderley M14-Oct-01 3:55 
GeneralRe: ADOX Create database file Pin
Christian Graus14-Oct-01 10:15
protectorChristian Graus14-Oct-01 10:15 
GeneralRe: ADOX Create database file Pin
Wanderley M15-Oct-01 8:44
Wanderley M15-Oct-01 8:44 
GeneralRe: ADOX Create database file Pin
Christian Graus15-Oct-01 10:46
protectorChristian Graus15-Oct-01 10:46 
Generalsimple client program for ATL ! Please HELP !!! Pin
13-Oct-01 21:25
suss13-Oct-01 21:25 
GeneralRe: simple client program for ATL ! Please HELP !!! Pin
Christian Graus13-Oct-01 23:12
protectorChristian Graus13-Oct-01 23:12 
GeneralRe: simple client program for ATL ! Please HELP !!! Pin
13-Oct-01 23:42
suss13-Oct-01 23:42 
GeneralPlease answer me !!!! It is very URGENT !!! Pin
13-Oct-01 23:46
suss13-Oct-01 23:46 
GeneralRe: Please answer me !!!! It is very URGENT !!! Pin
Christian Graus14-Oct-01 0:00
protectorChristian Graus14-Oct-01 0:00 
GeneralRe: Please answer me !!!! It is very URGENT !!! Pin
14-Oct-01 0:10
suss14-Oct-01 0:10 
GeneralRe: Please answer me !!!! It is very URGENT !!! Pin
Christian Graus14-Oct-01 0:31
protectorChristian Graus14-Oct-01 0:31 
GeneralRe: Please answer me !!!! It is very URGENT !!! Pin
14-Oct-01 1:02
suss14-Oct-01 1:02 
GeneralRe: Please answer me !!!! It is very URGENT !!! Pin
Christian Graus14-Oct-01 1:07
protectorChristian Graus14-Oct-01 1:07 
GeneralRe: simple client program for ATL ! Please HELP !!! Pin
Not Active14-Oct-01 6:41
mentorNot Active14-Oct-01 6:41 
GeneralDefine a String DLL Pin
Maer72713-Oct-01 19:13
Maer72713-Oct-01 19:13 
GeneralRe: Define a String DLL Pin
Sijin14-Oct-01 0:25
Sijin14-Oct-01 0:25 
GeneralRe: Define a String DLL Pin
Maer72714-Oct-01 0:55
Maer72714-Oct-01 0:55 

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.