|
Hi again,
Thank you for introducing CREATE PROCEDURE statment to me ...
I read MS-ACCESS help, too.
But i have problem in using of this statment,
I wanna tell you my problem:
I have OPERATION table with below fields:
PID1(long) - PID2(long) - OP(boolean)
I wanna query in access database with below query:
SELECT PID1, OP, PID2 FROM OPERATION
UNION ALL
SELECT PID2, NOT OP, PID1 FROM OPERATION
I wrote below code but doesn't work:
MyDB.Execute( "CREATE PROCEDURE TempQuery [NUMBER1] LONG, [OP] LOGICAL, [NUMBER2] LONG AS SELECT PID1, OP, PID2 FROM OPERATION UNION ALL SELECT PID2, NOT OP, PID1 FROM OPERATION" );
I wrote it too but doesn't work:
MyDB.Execute( "CREATE PROCEDURE TempQuery AS SELECT PID1, OP, PID2 FROM OPERATION UNION ALL SELECT PID2, NOT OP, PID1 FROM OPERATION" );
What is my wrong ???
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Bah... did you tried to run your query in Access? Not in code? I just tried and see that Access don't know what is that CREATE PROCEDURE, it want to get only CREATE TABLE statements
I used Access 2000 for test
Philip Patrick
"Two beer or not two beer?" (Shakesbeer)
Web-site: www.saintopatrick.com
|
|
|
|
|
Thanks for your helps !
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hi.
I would like to know how to concatenate characters into a string that is an element of a vector.
For example:
string dataTemp("today");
std::vector<string> vecTemp;
vecTemp.push_back(dataTemp);
// I want to add characters into the tring element of vecTemp
vecTemp[0] += " is Saturday." // Is that right?
I would like vecTemp[0] to be "today is Saturday."
Thanks,
Kuphryn
|
|
|
|
|
Hi.
Let say there are two vectors, vectorA and vectorB.
-----------------------------------------------------
string dataTemp;
std::vector<string> vectorA, vectorB;
for (int = 0; i < 10; ++i)
{
dataTemp += i;
vectorA.push_back(dataTemp);
}
/* The loop above should produce vectorA to look something like this:
0
1
12
123
1234
12345
123456
1234566
12345678
123456789
*/
Okay, vectorB is empty.
I want to copy *specific* elements from vectorA to vectorB.
For example:
vectorB.push_back(vectorA[4]); // Is that right?
vecotrB.push_back(vectorA[8]);
Thanks,
Kuphryn
|
|
|
|
|
I need to Check the first char of a string
to see if it is A, B, or C
are there any methods
to do that?
thank you
|
|
|
|
|
Let say you have this:
string temp("February");
if (toupper(&temp[0]) == "A")
...
Try that first because I have not tested it.
Kuphryn
|
|
|
|
|
You can try the GetAt() function:
CString str;
char ch = str.GetAt(0);
switch (ch)
{
case 'A':
{
//do something based on char A
return result;
}break;
case 'B':
{
//do something based on char B
return result;
}break;
case 'C':
{
//do something based on char C
return result;
}break;
}
Hope that helps, if not let us know.
Cheers
Jay Beckert
|
|
|
|
|
C:\My Documents\DataStru\Investors.cpp(7) : error C2653: 'Investors' : is not a class or namespace name
can anyone tell me why does it give this error? PLEASE
i have "investors.h" included in investors.cpp but it's still giving me this error
thank you
|
|
|
|
|
|
hi
I have loaded a CComboBox object m_combo with the list of drives using DirDlgListComboBox.I also used SetCurSel(0) to display the first element
in the loaded list.Now i want to display all the loaded data when somebody clicks on the dropdown arrow.So i added an event CBN_DROPDOWN .In the handler i added this line of code
m_combo.ShowDropDown();
This gives an unhandled exception.I have just started MFC programming .So if anybody can tell me why this happens and also suggest me to make it work correctly.
|
|
|
|
|
Combo boxes will dropdown when you click on the arrow by default. You don't need any extra code to make this work.
farewell goodnight last one out turn out the lights Smashing Pumpkins, Tales of a Scorched Earth
|
|
|
|
|
CString *temp1 = new CString("");
LPTSTR str1 = temp1->GetBuffer(temp1->GetLength());
int ret=this->DlgDirListComboBox(str1,IDC_DIRCOMBO,0,DDL_DRIVES);
if(ret==0)
{
DWORD i=::GetLastError();
}
int n=m_list1.GetCount();
//m_combo.SetCurSel(1); //default data is not displayed in comboBox is this is not done.
ret=m_combo.GetLBTextLen(1);
m_combo.GetLBText(1,m_list);
m_list.Delete(0,2);
m_list.Delete(1,2);
ret = m_list.GetLength();
m_list+=":\\";
str1 = m_list.GetBuffer(m_list.GetLength());
ret=this->DlgDirList(str1,IDC_LIST1,0,DDL_EXCLUSIVE|DDL_DIRECTORY);
if(ret==0)
{
DWORD i=::GetLastError();
}
//LPCTSTR t = m_list;
//m_list1.AddString(t);
m_list1.SetCurSel(0);
n=m_list1.GetCount();
Invalidate();
m_list.ReleaseBuffer();
temp1->ReleaseBuffer();
delete temp1;
this is how i generate data in ComboBox
For the ComboBox the properties are Style 1.type = "dropdown" 2.Owner draw = " no".......the dropdown list doesnot display
can u help
|
|
|
|
|
I've just udated my computer to use winxp, but I'm finding that I can't visual c++ debug to work properly with it. I used the NT upgrade util, but it says that the header wont work with xp. So, when I debug it gives error messages. This problem can't be that uncommon - does anyone know the answer? Do I need a service pack somthing?
With time we live, with money we spend!
Joel Holdsworth
|
|
|
|
|
I'm running VC6 SP 5 on Windows XP and debugging without a problem. What error messages are you being shown?
Michael
|
|
|
|
|
The SP5 bit might make a difference
thanks
With time we live, with money we spend!
Joel Holdsworth
|
|
|
|
|
hi all,
I want to pass CArray parameter to a member function.
How can i define function and how to call that...
I'm getting error "error C2955: 'CArray' : use of class template requires template argument list" on the defination line of this function
This is my defination
MyClass::MyFuynction(CArray& myArray) {
...
}
Thanks for taking time to write in.
--Sumit
modified 1-Aug-19 21:02pm.
|
|
|
|
|
I think, you need to pass MyFunction(CArray<cfoo, cfoo=""> &myarray), where CFoo is the name of the classes which the array is made of. The error message is a complaint about the fact that you havn't specified what type of array. It could be an arry of anything for all the compiler knows, and you can't just have a generic CArray - you need to specify what the array is an array of...
With time we live, with money we spend!
Joel Holdsworth
|
|
|
|
|
I am interested in including alert windows for an application I am writing that are similar to those that gator and msn messenger pop up (the little boxes in the bottom right of the screen). I have done some searching around on the site, I havn't found anything that does what I am looking for. It very well could be that I just don't know what to look for as I don't know what you would call that little window. If anybody could point me in the right direction I would greatly appreciate it!
Thanks,
Paul
--
Paul Tinsley
<paul@ecymtech.com>
|
|
|
|
|
I seem to have found the answer to my own question If anybody else is looking to do the same thing the answer can be found here: http://www.codeproject.com/useritems/statusbarmsgwnd.asp
--
Paul Tinsley
<paul@ecymtech.com>
|
|
|
|
|
Can anyone send me the code of check CD-ROM's door opened or closed?
Such as:
BOOL CXXXXX::CheckCDDoorOpenedOrClosed()
{
....
}
Thanks.
A VC++ beginer
|
|
|
|
|
Have a look into MSDN document
HOWTO: Getting Notification of CD-ROM Insertion or Removal
Here is the sample code from it
Sample Code
The following code demonstrates how to use the WM_DEVICECHANGE message to check for compact disc or DVD insertion or removal.
#include <windows.h>
#include <dbt.h>
char FirstDriveFromMask (ULONG unitmask); //prototype
/*----------------------------------------------------------------------
Main_OnDeviceChange (hwnd, wParam, lParam)
Description
Handles WM_DEVICECHANGE messages sent to the application's
top-level window.
----------------------------------------------------------------------*/
void Main_OnDeviceChange (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
PDEV_BROADCAST_HDR lpdb = (PDEV_BROADCAST_HDR)lParam;
char szMsg[80];
switch(wParam)
{
case DBT_DEVICEARRIVAL:
// See if a CD-ROM or DVD was inserted into a drive.
if (lpdb -> dbch_devicetype == DBT_DEVTYP_VOLUME)
{
PDEV_BROADCAST_VOLUME lpdbv = (PDEV_BROADCAST_VOLUME)lpdb;
if (lpdbv -> dbcv_flags & DBTF_MEDIA)
{
wsprintf (szMsg, "Drive %c: arrived\n",
FirstDriveFromMask(lpdbv ->dbcv_unitmask));
MessageBox (hwnd, szMsg, "WM_DEVICECHANGE", MB_OK);
}
}
break;
case DBT_DEVICEREMOVECOMPLETE:
// See if a CD-ROM was removed from a drive.
if (lpdb -> dbch_devicetype == DBT_DEVTYP_VOLUME)
{
PDEV_BROADCAST_VOLUME lpdbv = (PDEV_BROADCAST_VOLUME)lpdb;
if (lpdbv -> dbcv_flags & DBTF_MEDIA)
{
wsprintf (szMsg, "Drive %c: was removed\n",
FirstDriveFromMask(lpdbv ->dbcv_unitmask));
MessageBox (hwnd, szMsg, "WM_DEVICECHANGE", MB_OK);
}
}
break;
default:
/*
Other WM_DEVICECHANGE notifications get sent for other devices
or reasons; we don't care about them here. If they were
important, we would check for them and act accordingly.
*/
;
}
}
/*----------------------------------------------------------------------
FirstDriveFromMask (unitmask)
Finds the first valid drive letter from a mask of drive letters. The
mask must be in the format bit 0 = A, bit 1 = B, bit 3 = C, etc.
A valid drive letter is defined when the corresponding bit is set to
1.
Returns the drive letter that was first found.
----------------------------------------------------------------------*/
char FirstDriveFromMask (ULONG unitmask)
{
char i;
for (i = 0; i < 26; ++i)
{
if (unitmask & 0x1)
break;
unitmask = unitmask >> 1;
}
return (i + 'A');
}
Although this sample code only checks for volume arrivals due to the insertion of new media, it can be extended to get notification of other hardware events for other types too. To do so, you have to add cases for other device events and handle different device types for each event.
Happy programming!!
|
|
|
|
|
Hello i am new in using the ATL. i have a probelm my to set and get HREF of a frame.
My dll is instanted by a ASP . Now i am not able to get HREF (URL) of the page.
Please help
|
|
|
|
|
Hi,
I have a window,in which i do display a image.it works fine.But if i move the window outside the window screen( by draging )image will be erased.I do display the image though BitBlt().
Any idea?
Neha
|
|
|
|
|
Do the drawing of the image in the window in the OnEraseBackgrnd handler.
Happy programming!!
|
|
|
|