|
This is a bug with Microsoft Data Access Components versions 2.1, 2.5, 2.6
an excessive amount of network packet activity occurs, even when the ODBC connection is idle
It is caused by wrong interpetation of the timout value.
since it is expecting to be in miliseconds and you set it to seconds.
Also, if you create a new ODBC data source with the MDAC 2.1 or later version of the Access ODBC Driver, the driver incorrectly uses a default value of 5 for PageTimeout. The correct default value should be 5000 with the MDAC 2.1 version of the driver.
See MSDN for The resolution:
[SNIP]
"
The recommended setting for PageTimeout with the MDAC 2.1 or later version of the Microsoft Access ODBC driver is 5000. To change this value, click Options in the ODBC data source and modify the PageTimeout value.
You can also add this to your ODBC connection string. For example, here is an ODBC connection string that uses a DSN as well as adds the PageTimeout setting:
"DSN=MyODBCDataSource;PageTimeout=5000;"
Here is an example ODBC connection string that uses a DSN-less connection as well as adds the PageTimeout setting:
"Driver=Microsoft Access Driver (*.mdb);PageTimeout=5000;DBQ=C:\MyFile.doc;"
[/SNIP]
Click here for article
Cheers
Alfadhly
/*
It is Illogical to define an inventor by his invention
*/
|
|
|
|
|
Thanks, this sorted the problem.
David Osborn
|
|
|
|
|
Hi all,
I've written a library and I would like to specify in the source code additionnal include and library path to avoid specify in the Project/Settings in each project I've made...
I know that we can specify libray to include to the linker in this way:
#pragma comment(lib,"test.lib")
...and that work correctly. I've seen on MSDN that we can set some linker options like this:
#pragma comment(linker, "LIBPATH :\lib")
...but it seems to do nothing and we can't specify additionnal include directories...
Thx in advance...
|
|
|
|
|
Just a guess: change d:\lib to d:\\lib.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Sorry, I've done an error in my example... It is "d:/lib" not "d:\lib"
|
|
|
|
|
I am reading field values from records which then i convert to CString
_Recordset rs;
variant_t var = rs->Fields->GetItem (variant_t ("name"))->Value;
then i try to convert to CString var:
var.ChangeType (VT_BSTR);
CString strName = var.bstrVal;
whenever field has NULL i got error of access violation
please help
|
|
|
|
|
would
CString name;
if (var.bstrName)
name = var.bstrVal;
else
// go home
work ?
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
it did not or I made something wrong:
variant_t vGroupID = rsMenu->Fields->GetItem (_variant_t ("group_id"))->Value;
vGroupID.ChangeType (VT_BSTR);
if (vGroupID.bstrVal)
{
sGroupID = vGroupID.bstrVal;
}
else
sGroupID = "NULL";
i got the same error
|
|
|
|
|
try checking var.vt for VT_NULL (and VT_EMPTY possibly)
maXallion "Is there any Tea on this Spaceship?" - Arthur Dent
Home of The Code Devil
|
|
|
|
|
it works, but probably what i have done is NOT the best coding example
CString sGroupID;
variant_t vTest;
variant_t vGroupID;
vTest.ChangeType (VT_NULL);
vGroupID = rsMenu->Fields->GetItem (_variant_t ("group_id"))->Value;
if (vGroupID != vTest)
{
vGroupID.ChangeType (VT_BSTR);
sGroupID = vGroupID.bstrVal;
}
else
sGroupID = "NULL";
thank you
|
|
|
|
|
that should do the job:
CString sGroupID;
_variant_t vGroupID;
vGroupID = rsMenu->Fields->GetItem (_variant_t ("group_id"))->Value;
if (vGroupID.vt != VT_NULL)
sGroupID = (LPCTSTR)_bstr_t(vGroupID);
else
sGroupID = "NULL";
maXallion "Is there any Tea on this Spaceship?" - Arthur Dent
Home of The Code Devil
|
|
|
|
|
I wanna run exe file from another software that i code in VC++...I can run int using WinExec.......But i need to know how to use CreateProcess or ShellExcute function...
Plz someone....
THANX
|
|
|
|
|
Here's some sample code, perhaps it helps:
(havn't tested it, though)
STARTUPINFO supi;
PROCESS_INFORMATION proci;
GetStartupInfo (&supi); supi.lpDesktop = "";
CString strCmd = "notepad.exe";
BOOL bOK = CreateProcess(NULL,strCmd.LockBuffer(),NULL,NULL,
FALSE,CREATE_DEFAULT_ERROR_MODE | NORMAL_PRIORITY_CLASS,
NULL,NULL,&supi,&proci);
WaitForSingleObject(m_hProcess,INFINITE); //wait until the program is closed
maXallion "Is there any Tea on this Spaceship?" - Arthur Dent
Home of The Code Devil
|
|
|
|
|
thanx u very much......I need to know how WaitForSingleObject works.......When i include this function, there is no difference...
|
|
|
|
|
thanx u very much......I need to know how WaitForSingleObject works.......When i include this function, there is no difference...
|
|
|
|
|
How can i check whether user can pree ctrl key
Dinesh Asanka
|
|
|
|
|
Do you mean can they press it, or have they pressed it ? If the latter, GetASyncKeyState(VK_CONTROL)
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Do you mean can they press it, or have they pressed it ? If the latter, GetASyncKeyState(VK_CONTROL)
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
I'm trying to use the grid control in a CFormView-based class, by inserting a custom control in the dialog. My application fails with "Failed to create empty document" message at startup, the trace information from a debug run is as follows:
WndProc: hwnd=0x4C03D6, msg = WM_GETMINMAXINFO (0x0000, 0x0012F9FC)
WndProc: hwnd=0x4C03D6, msg = WM_NCCREATE (0x0000, 0x0012F9D0)
WndProc: hwnd=0x4C03D6, msg = WM_NCCALCSIZE (0x0000, 0x0012FA1C)
WndProc: hwnd=0x4C03D6, msg = WM_CREATE (0x0000, 0x0012F9BC)
WndProc: hwnd=0x2D02FE, msg = WM_NCCREATE (0x0000, 0x0012F394)
WndProc: hwnd=0x2D02FE, msg = WM_NCCALCSIZE (0x0000, 0x0012F3C4)
WndProc: hwnd=0x2D02FE, msg = WM_CREATE (0x0000, 0x0012F394)
WndProc: hwnd=0x2D02FE, msg = WM_SIZE (0x0000, 0x014501E0)
WndProc: hwnd=0x4C03D6, msg = 0x0368 (0x0000, 0x0012F0E4)
WndProc: hwnd=0x2D02FE, msg = WM_MOVE (0x0000, 0x00000000)
WndProc: hwnd=0x4C03D6, msg = WM_PARENTNOTIFY (0x0001, 0x002D02FE)
WndProc: hwnd=0x2D02FE, msg = WM_SETFONT (0x500A043F, 0x00000000)
WndProc: hwnd=0x4C03D6, msg = WM_PARENTNOTIFY (0x0002, 0x002D02FE)
WndProc: hwnd=0x2D02FE, msg = WM_DESTROY (0x0000, 0x00000000)
WndProc: hwnd=0x2D02FE, msg = WM_NCDESTROY (0x0000, 0x00000000)
Warning: could not create view for frame.
Failed to create client pane/view for frame.
WndProc: hwnd=0x4C03D6, msg = WM_DESTROY (0x0000, 0x00000000)
WndProc: hwnd=0x4C03D6, msg = WM_NCDESTROY (0x0000, 0x00000000)
Warning: Window creation failed: GetLastError returns 0x00000000
Warning: failed to create CFrameWnd.
Warning: CDocTemplate couldn't create a frame.
The thread 0x4C4 has exited with code 0 (0x0).
The program 'D:\TEMP\gctest\Debug\gctest.exe' has exited with code 0 (0x0).
The first warning is caused by ::CreateDialogIndirect() failing when the CMainFrame is being created. Then everything else fails because there is no main window.
Any idea why the window creation fails? Is some additional initialization needed?
|
|
|
|
|
hi..if u wanna use gridcontrol... use active X.....Add dbgrid control and ado to your project......assign ado topo a recordsource......\
Set SQL in ado... Call the the id of ado from the dbgrid control......Add table and recordset u wanna call in dbgrid.....
These thing can be done in resource workshop that is in something.rc file....No need to code anything in the CMainFrm......
Ur problem occurs becoz another program might have running the recorsource at the sametime....
"LIFE IS AN ADVENTURE THAT SHOULD BE LIVED.... LOVE IS A PROBLEM THAT SHOULD SOLVED...LOVE YOUR LIFE!!"
CVASIVA
|
|
|
|
|
I guess I should have specified that I am trying to use Chris Maunder's MFC Grid Control 2.22, not an ActiveX component. I need a control with checkboxes and date pickers as cells.
Anyway, I solved the first problem myself, I had to include a member variable for the control in the view class (not mentioned in the documentation). But the control still doesn't work, in fact it doesn't appear at all on the dialog. Debugging shows that the control's Create() function isn't called.
Isn't the MFC framework supposed to Create() all the controls defined in the dialog template? If I must Create() the control myself, how do I access the control position and size information defined in the dialog editor?
|
|
|
|
|
> Isn't the MFC framework supposed to Create() all the controls
> defined in the dialog template?
Only if you add the corresponding call to DDX_Control in DoDataExchange.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Thanks, this was just the information I needed
|
|
|
|
|
Try EasyGrid ActiveX as a substitute.
It must will be very helpful.
Download is available @
http://www.share2.com/easygrid/
|
|
|
|
|
Hi y'all!
I've got myself into a nasty situation again. I had to create a client and server application which would be put on different PC's and communicate using simple modems (analogue and ISDN).
Not having a good component for serial communication and having to build a protocol of our own on top of it, I used the MSComm ActiveX object in Visual C++ 6 (with Win2K SDK) for talking with the modems on the COM ports.
But when we started stress testing it, it turned out that the client suffered from a rather huge memory leak, and it wasn't in my code! (I'm sure of this, because a debug build doesn't dump any memory and the only thing that keeps on rising is the number of used CRT-blocks). The weird thing is that the server application uses the MSComm object almost in the same way and doesn't have this leak at all.
When continually connecting and talking to each other the client application rises about 20 Kb each minute, so within an hour or 8 the Client PC will be swapping like crazy.
The ONLY difference between the two programs is that the server application is the dialing party and the client application is the waiting party.
Anyone ever had the same problem??? I think there must be some difference in the order of function calls. Could this really be of any difference???
Structured programming vs. chaotic mind boggling
|
|
|
|