"Unhandled exception in XXX.exe (ODBC32.dll): 0xC0000005: Access Violation."
This error is caused due to the array. If you exceed the index allocated then this error is called. In the debug version do you see First Time exception handled ...
If you get the pathname using GetPathName()
You can then use the C function strtok(pathname,"\\").
put the above funtion in a while loop and this will split the file name into all required components.
example:
CString CSIMAppDlg::GetFileName(CString strPathname)
{
char seps[] =...
The problem is with the edit().
You need to put this inside the while loop.
For every update statement you require and edit() or addnew().
As you have the edit() outside the while loop the code runs once fine and then fails as you try to update without and edit.
Hope this helps.
Have you compiled with Dynamic or Static MFC libraries.
In the general tab of the projects settings change the MFC library to static.
This should cure your problem.
In the CRecordset there is a variable called
m_strFilter
Intialise this before using the open method.
i.e.
CEmpRst (NULL) or CEmpRst(&db)
rst.m_strFilter.Format("ID = '%d'", nID);
rst.Open();
This will only retrieve records that match the ID
Hope this helps.
Your could write a token check ?
If you use the standard Library Function
i.e.
char szDataBuffer[1024];
char *szToken;
char szSeps[]="{}(),";
szToken = strtok(szDataBuffer, szSeps);
while(szToken != NULL)
{
szToken = strtok(NULL, szSeps);
}
szToken should hold the...
You could use a string array then use the array index for the switch statement
char *strArray[] = { "String 1", "String 2"};
for (int nLoop = 0; nLoop < sizeof(strArray) / sizeof(strArray[0]); nLoop++);
{
if (strncmp(&strArray[nLoop], strCheck, strlen(strCheck)) break;
}...
Hi,
You may need to add the Library in the link options
or
use TOOLS / OPTIONS / Directories
and add the path for the include and library files
Hope this Helps
DazzG
If you need to return more than 1 parameter. Instead of passing pointers for individual parameters to functions it may be better to pass a pointer to a structure.
If more info is required then let me know
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.