|
here is the SQL:
//========================
update [MY_TABLE]
set REMARK = 'hello',
SET_TIME = '05/06/2008 10:47:27'
where TAB_ID = 17605
and LOG_ID = 20061
and USER_ID = 'ME'
and SET_TIME = '5/6/08 10:37:28 AM'
error info is:
Data type mismatch in criteral expression (3464)
//============================
If I delete last line, the SQL is executed correctly:
update [MY_TABLE]
set REMARK = 'hello',
SET_TIME = '05/06/2008 10:47:27'
where TAB_ID = 17605
and LOG_ID = 20061
and USER_ID = 'ME'
//==============================
I open the table, all data:
where TAB_ID = 17605
and LOG_ID = 20061
and USER_ID = 'ME'
and SET_TIME = '5/6/08 10:37:28 AM'
are there.
could you find why?
thanks
|
|
|
|
|
includeh10 wrote: and SET_TIME = '5/6/08 10:37:28 AM'
Have you tried SET_TIME = '05/06/20008 10:37:28 AM' instead?
PS: Please do not annoy by repeatedly posting the same stuff. If nobody replied, that could most probably mean that you haven't given enough information. Try rephrasing the query or explaining it better instead of reposting it several times. Reposting/Cross-posting will get you ignored fast.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
what about if you remove the "AM" from the literal ?
BTW, we have a SQL forum, if you don't mind
|
|
|
|
|
Hi,
Wondering if anyone has any good ideas here...
I have written a custom CStatusBar control which basically updates
some panes in color as the mouse cursor is moved around. The panes
were flickering due to the amount of redrawing required so I added
some code that uses double-buffering to draw the panes off-screen
first, then blits to screen. I used a well-known piece of code from
Keith Rule on CodeProject in the CMemDC class for this
(http://www.codeproject.com/KB/GDI/flickerfree.aspx?msg=2531592#xx2531592xx).
Here's the code for that:
***********************************************************************************
<br />
class CMemDC : public CDC {<br />
private:<br />
CBitmap m_bitmap;
CBitmap* m_oldBitmap;
CDC* m_pDC;
CRect m_rect;
BOOL m_bMemDC;
public:<br />
<br />
CMemDC(CDC* pDC, const CRect* pRect = NULL) : CDC()<br />
{<br />
ASSERT(pDC != NULL);<br />
<br />
m_pDC = pDC;<br />
m_oldBitmap = NULL;<br />
m_bMemDC = !pDC->IsPrinting();<br />
<br />
if (pRect == NULL) {<br />
pDC->GetClipBox(&m_rect);<br />
} else {<br />
m_rect = *pRect;<br />
}<br />
<br />
if (m_bMemDC) {<br />
CreateCompatibleDC(pDC);<br />
pDC->LPtoDP(&m_rect);<br />
<br />
m_bitmap.CreateCompatibleBitmap(pDC, m_rect.Width(),<br />
m_rect.Height());<br />
m_oldBitmap = SelectObject(&m_bitmap);<br />
<br />
SetMapMode(pDC->GetMapMode());<br />
<br />
SetWindowExt(pDC->GetWindowExt());<br />
SetViewportExt(pDC->GetViewportExt());<br />
<br />
pDC->DPtoLP(&m_rect);<br />
SetWindowOrg(m_rect.left, m_rect.top);<br />
} else {<br />
m_bPrinting = pDC->m_bPrinting;<br />
m_hDC = pDC->m_hDC;<br />
m_hAttribDC = pDC->m_hAttribDC;<br />
}<br />
<br />
FillSolidRect(m_rect, pDC->GetBkColor());<br />
}<br />
<br />
~CMemDC()<br />
{<br />
if (m_bMemDC) {<br />
m_pDC->BitBlt(m_rect.left, m_rect.top, m_rect.Width(),<br />
m_rect.Height(),<br />
this, m_rect.left, m_rect.top, SRCCOPY);<br />
<br />
SelectObject(m_oldBitmap);<br />
} else {<br />
with<br />
m_hDC = m_hAttribDC = NULL;<br />
}<br />
}<br />
<br />
CMemDC* operator->()<br />
{<br />
return this;<br />
}<br />
<br />
operator CMemDC*()<br />
{<br />
return this;<br />
}<br />
};<br />
***********************************************************************************
Applying this code requires overriding the OnPaint & OnEraseBkgnd
methods in the custom CStatusBar as follows:
<br />
void MyStatusBar::OnPaint()<br />
{<br />
CPaintDC dc(this);
CRect rect;<br />
GetClientRect(&rect);<br />
CMemDC memDC(&dc, &rect);<br />
<br />
DefWindowProc(WM_PAINT, (WPARAM)memDC->m_hDC, (LPARAM)0);<br />
<br />
}<br />
<br />
BOOL MyStatusBar::OnEraseBkgnd(CDC* pDC)<br />
{<br />
return TRUE;<br />
<br />
}<br />
<br />
This reduces the flickering, but now the pane borders don't get drawn
at all - they just appear as blank white areas. I have tried
overriding the OnNcPaint function to avoid the call to
CControlBar::EraseNonClient(). No effect. I have also tried calling
DrawBorders explicitly with likewise no effect.
Does anyone have any idea what I'm missing here?
Any suggestions would be much appreciated.
Best,
Bruce
|
|
|
|
|
blamond wrote: // Fill background
FillSolidRect(m_rect, pDC->GetBkColor());
replace this statement in CMemDC to
HBRUSH hbrBackGrnd = (HBRUSH)GetClassLong(pDC->GetWindow()->GetSafeHwnd(),
GCL_HBRBACKGROUND);
::FillRect(GetSafeHdc(), &m_rect, hbrBackGrnd);
|
|
|
|
|
Rajkumar gets large quantities of kudos...
Your fix did the trick, and saved me a few hours of head-bashing no doubt.
Thanks very much!
Bruce
|
|
|
|
|
In our application, we would like to update our view based on the user's selection in a combo box like office 2007 does to change font size. We notice that when you highlight a font size from the combo box, you can preview the size change without the need to hit "Enter" or any other "Apply" trigger. How can we do that? Does the combo box of new version of Visual Tools have the event trigger automatically? Thank you very much!
|
|
|
|
|
|
Is there a way to detect if a view is in print preview mode without using a Device Context or CPrintInfo?
I am using MFC Doc/View
modified on Monday, May 5, 2008 4:59 PM
|
|
|
|
|
void CViewDerivedClass::OnPrint(CDC* pDC, CPrintInfo* pInfo)
{
if(pInfo->m_bPreview)
{
}
}
CPrintInfo structure is passed as a parameter to all printing related functions of a CView derived class.
modified on Monday, May 5, 2008 4:58 PM
|
|
|
|
|
My bad. I forgot to indicate the "without DC" thing better.
Is there a flag or method outside of any particular view to allow one to determine if the the app is in print preview mode?
By the way, thanks for taking the time to help. Sorry I didn't state my problem clearer the first time.
|
|
|
|
|
You can keep track of it yourself via overriding following function.
virtual void CFrameWnd::OnSetPreviewMode(BOOL bPreview, CPrintPreviewState* pState);
|
|
|
|
|
|
I'm trying to print the contents of a web browser control using the web browser's ExecWB method as follows:
m_ctrlWebBrowser.ExecWB(OLECMDID_PRINT, 1, NULL, NULL);
Everything works great in debug, but in release an exception is thrown.
I have no idea how to determine what the problem might be, and searching online I haven't been able to find anyone else who's had this problem, or any other info about what else I might need to do besides just calling ExecWB().
Any ideas greatly appreciated! I'm kind of a newbie, so please include as much detail as possible.
(I'm using Visual C++ 5.0 / MFC, by the way... and IE 6.0)
Thanks much
|
|
|
|
|
use ExecW's Quit method .. it will work fine
|
|
|
|
|
How canbe formatted a partition in VC++ 6?
I found a function, FormatPartition() but it doesn't work with what I'm using. Has anybody a solution?
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
Does it give you any error or something that we can look at?
|
|
|
|
|
I got an answer from Mukesh Kumar
Thanks
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
AFAIK FormatPartition() is used for Windows CE and for smart devices. VC++ 6 does not support smart device development. Use eVC++ or VS 2005 to use this function.
By the way, For which platform you are using this function?
Smart device or Desktop Development???
Mukesh Kumar
Software Engineer
|
|
|
|
|
For Desktop
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
|
My friend, this time I had to balance the troll's vote to your reply.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Thanks my friend but it seems my answer was important because I got 4 votes!?
|
|
|
|
|
I got an answer from Mukesh Kumar
Thanks anyway
36. When you surround an army, leave an outlet free.
...
Do not press a desperate foe too hard.
SUN-TZU - Art of War
|
|
|
|
|
I am having a dialog control with edit boxes in it and when I type in those boxes and hit 'Enter' key the dialog closes. I am not having any OK or Cancel buttons (I deleted them as soon as I created the dialog). I want to replicate tab behavior when I hit 'Enter' key and also for a couple of edit boxes in the same dialog I have declared handlers to do some processing as below-
ON_NOTIFY(EN_MSGFILTER, IDE_CONTROL, UpdateControl)<br />
CWnd* wnd;<br />
wnd = GetDlgItem(IDE_CONTROL);<br />
wnd->SendMessage(EM_SETEVENTMASK, 0, ENM_KEYEVENTS);<br />
void CControlDlg::UpdateControl(WPARAM wParam, LPARAM lParam) <br />
{<br />
}
How can I perform both of these functions at the same time (disabling enter key/escape key from closing the dialog, while processing the above function when you hit 'Enter' key in some single line edit boxes)??
thanks for any help.
PKNT
|
|
|
|