|
Hi,
I am using VC6.0++ with DAO & MS Access97! So far I use SQL successfully ... well except 2 thing:
*) With this: strSQL.Format ("SELECT * FROM Sample WHERE Title != 'Date'"); I can search the whole Sample table at column "Title" for string "Date"!
1) Let say to do the same, how can I search ... but at any cell has some thing (not empty string, or not empty field)?
2) In the table there is a column with define as COleDateTime, how can I search the same above technique for a equivalent COleDateTime day:
ie: Search for cell has "12/31/2001" in the column "Date"
I appreciate any help help here
Many thanks,
Anh
|
|
|
|
|
1) I think that SELECT * FROM Sample WHERE title <> '' AND title IS NOT NULL (I'm not sure if title IS NOT NULL is necessary).
2) SELECT * FROM Sample WHERE Date = '2001-31-12' should do the trick. Beware if the time is included you may have to issue SELECT * FROM Sample WHERE Date >= '2001-31-12' AND Date < '2001-31-12' .
Try those.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
Hi Michel,
Thank you very much for request #1, it works beautifully! However, the suggestion for #2, I tried and failed! Did you try it successfully, or might be I missing some thing?
Many thanks,
Thanh
|
|
|
|
|
I don't know MS Acces at all, but I know that for the SQL server to understand your date format, you must know the locale it uses.
For instance, in en-US (0x409 or 1033), '12/31/2001' (try that), in fr-CA (0xC0C or 3084), '31/12/2001', etc...
Somebody once suggested the format I put in #2 to be locale-independant, but it doesn't seem to work in Access. Try the '12/31/2001' and see what happens.
Michel
It is a lovely language, but it takes a very long time to say anything in it, because we do not say anything in it, unless it is worth taking a very long time to say, and to listen to.
- TreeBeard
|
|
|
|
|
newbie beware!
okay, i create a button
HWND myhwnd;
myhwnd = CreateWindowEx(WS_EX_STATICEDGE,"Button","About",WS_CHILD|WS_VISIBLE|BS_PUSHBUTTON,10,10,25,15,parent,(HMENU)ID,hInst,0);
the font is bold by default, how can i set the font.
Any good reading here, really appreciated, as always, any helps appreciated also.
shotgun
|
|
|
|
|
|
If I install VS.NET will it interfer with previous installation of visual c++ 6.0???
|
|
|
|
|
Nope, I have them happily co-existing on my machine and from what I've seen most other people have had no problems either. Just as well, people are just too damned comfortable in VC6
--
Paul
"I need the secure packaging of Jockeys. My boys need a house!"
- Kramer, in "The Chinese Woman" episode of Seinfeld
MS Messenger: paul@oobaloo.co.uk
Sonork: 100.22446
|
|
|
|
|
Apparently, during installation, you have to give the common directory a different name so it is not the same as the VC6 one but I accidentally did this and have experienced no problems so far.
Must admit since getting VS.NET, 90% of my time is spent on VC6. It's not that much better to warrant the change at the moment unless you specifically need the .NET features.
Adam.
www.beachwizard.com/travelogue[^]
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
Iv'e declared:
<font color=blue>class MyClass</font><br />
{<br />
<font color=blue>typedef void</font> (<font color=blue>MyClass</font>::* MyClassMethodPtr)();<br />
<br />
<font color=blue>MyClass</font>()<br />
{<br />
m_pMethod = voidMethod; <font color=green>
m_pMethod(); <font color=green>
}<br />
<br />
MyClassMethodPtr m_pMethod;<br />
<font color=blue>void</font> voidMethod()<br />
{<br />
<font color=green>
}<br />
};
Why??? Howto create useable pointer-to-classMembFunc???
--BlackSmith--
/*The roof is on fire, we don't need no water, let the MF burn*/. BHG.
|
|
|
|
|
BlackSmith wrote:
Howto create useable pointer-to-classMembFunc???
in general, you can't use non-static member functions via a function pointer.
it works fine, tho, if you rewrite the code like so:
class MyClass
{
typedef void (* MyClassMethodPtr)();
MyClass()
{
m_pMethod = voidMethod;
m_pMethod();
}
MyClassMethodPtr m_pMethod;
static void voidMethod()
{
}
};
-c
As always, it's bread and circuses. And while bread is down right now, circuses are way up.
|
|
|
|
|
The questioner was asking about a member function pointer.
You can not use a static member function with a member function pointer.
You can however, use a function pointer with a static member function.
Function pointers and member function pointers are two different things, and you can't mix them.
|
|
|
|
|
(m_Obj.*m_Func)()
Try the following:
MyClass()
{
m_pMethod = voidMethod; //OK
(*m_pMethod)();
}
To use function pointers you have to use some funcky looking syntax.
If you're calling the function from inside your class, just prefix the pointer with an asterick, and wrap perantesise around it:
(*MyFunPtr_Array)();
If you're doing it out side of the class, you would use the following syntax:
(MyClassVar.*m_Func)();
|
|
|
|
|
Axter wrote:
Try the following:
MyClass()<br />
{<br />
m_pMethod = voidMethod;
(*m_pMethod)(); <font color=red>
Error1: error C2171: '*' : illegal on operands of type 'void (__thiscall MyClass::*)(void)'<br />
Error2: error C2064: term does not evaluate to a function<br />
</font>}
Whattodo?????
--BlackSmith--
/*The roof is on fire, we don't need no water, let the MF burn*/. BHG.
|
|
|
|
|
I tested the proposed solution I gave you on VC++, and for some reason it doesn't like the syntax without the class prefix.
If you're using VC++, try the following instead:
class MyClass
{
public:
typedef void (MyClass::* MyClassMethodPtr)();
MyClassMethodPtr m_pMethod;
MyClass()
{
m_pMethod = voidMethod; //OK
((*this).*m_pMethod)();
}
void voidMethod()
{
//Do do do, boo boo boo...
printf("Hello World");
}
};
|
|
|
|
|
Thanks man, this works (For real?! for sure!)
--BlackSmith--
/*The roof is on fire, we don't need no water, let the MF burn*/. BHG.
|
|
|
|
|
Hi,
I have an array like this :
char sArray[4][5];
I want to declare this array with new or malloc like this :
char** sArray=NULL;<br />
sArray = new char[20];<br />
or sArray = (char*)malloc(20);
Can anybody help me to write correct declaration
Thanks in advance
|
|
|
|
|
there is no simple way to do it in C++.
you will have to do something like this:
int ** array = new int* [sizex];
for (int i = 0; i < sizex; ++i)
array[i] = new int[sizez];
-c
"Half of the harm that is done in this world is due to people who want to feel important."
-- TS Elliot
|
|
|
|
|
Hi,
I've made a bad choice in implementing the icon retrieving code in my code. But's hardcoded now and would be toough and bug producing to make any really major corrections now.
So anyway, the question: I need to get the icon of some file (SHGetFileInfo), but with shortcut overlay (or shared overlay, but this is not neccessary), for both 16x16 and 32x32 icons. In other words, a image list that would contain both "shortcuted" and standard icons.
Thanks in advance
|
|
|
|
|
|
Hello there,
How can i convert my Unicode string to Arabic 1256 codepage ?
Arabic 1256 is ANSI ???
I mean for solving my problem i must convert Unicode characters to ANSI ??
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hi All,
I've been having weird heap breakpoints show up in an app that is using the winsock 2 library, and have heard that this may be related to the version of the C runtime libraries I am linking with. Anybody know which version is the corrcet one to use with the winsock libraries? Multithreaded, Single Threaded, Multithreaded .dll?
Thanks
Aaron
|
|
|
|
|
My VB function signature is:
Public Function MakeDB(txtFilename As String, dataBaseName As String)
I will pass these two parameters from VC as:
CString dbName, myFile;
edit1.GetWindowText(dbName);
edit2.GetWindowText(myFile);
ptr->MakeDB(myFile, dbName)
What I need to know is can I do this or do CStrings and VB strings differ. if so, how to pass these strings to the VB dll?
Thanks,
ns
|
|
|
|
|
Well, I did what I said above, and got the VC compile error:
C:\msway\mswayView.cpp(174) : error C2664: 'MakeDB' : cannot convert parameter 1 from 'class CString' to 'unsigned short ** '
with:
ptr.CreateInstance(__uuidof(Class1));
ptr->MakeDB(strFile,dataBaseName);
on the VC side
and
Public Function MakeDB(txtPMAFilename As String, dataBaseName As String)
on the VB side.
Help!!
Thanks,
ns
(ps. I am going to convert my CStrings into char * but dont know if that will do it...)
|
|
|
|
|
Nope. this time with char* passed into VB, I got the compile error in VC:
C:\Trainer\A_TR NOBlob inDB series\VBDBDll2\msway\mswayView.cpp(185) : error C2664: 'MakeDB' : cannot convert parameter 1 from 'char *' to 'unsigned short ** '
Now what to try?
Thanks,
ns
|
|
|
|