|
This didnt pass the compiler: IsEOF is a dao thing, EOF is not an ADO thing either. getting close though....
Thanks for the responses,
ns
OOPS! I think I need ->EOF not .EOF....I'm trying it now.
DArn! That wasnt it.
|
|
|
|
|
|
guess what - I tried that too....I really did.
Compiling...
Train1View.cpp
C:\Train1View.cpp(2473) : error C2059: syntax error : '('
C:\Train1View.cpp(2474) : error C2143: syntax error : missing ';' before '{'
C:\Train1View.cpp(2475) : error C2039: 'AfxMessageBox' : is not a member of '_Recordset'
c:\trainer\a_tr series\tr8b\release\msado15.tlh(1696) : see declaration of '_Recordset'
C:\Train1View.cpp(2488) : error C2039: 'm_photoDb' : is not a member of '_Recordset'
c:\trainer\a_tr series\tr8b\release\msado15.tlh(1696) : see declaration of '_Recordset'
C:\Train1View.cpp(2488) : error C2039: 'GetPhotoBuffer' : is not a member of '_Recordset'
c:\trainer\a_tr series\tr8b\release\msado15.tlh(1696) : see declaration of '_Recordset'
Error executing cl.exe.
|
|
|
|
|
Mail me Train1View.cpp . Looks like you got a misplaced -> .
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I think it depends how you import the ADO code, but in my version "EOF" is renamed to "adoEOF" because of the conflict with the C EOF define for end of file returned by fgetc etc...
try...
if ((m_photoDb.m_pRecordsetPhoto->BOF == TRUE)
&& (m_photoDb.m_pRecordsetPhoto->adoEOF == TRUE))
{
AfxMessageBox ("empty rs");
return;
}
Blade[DMS]
|
|
|
|
|
I checked for the recordcount and used that instead. SO the original mystery is unsolved, but I have a workaround..
|
|
|
|
|
I would be careful on how you use the recordcount method. I think this is just a water mark of the number of records you have iterated through.
The count that it returns is only correct if you have iterated through the whole recordset.
You have to use EOF and BOF to work out if you have any records.
When you Import the ADO object you usually rename EOF to what ever you want
|
|
|
|
|
If you are using namespaces then you may need to say something like ADODB::EOF or ADODB::adEOF etc. Check the .tlh file and see what the constant is.
|
|
|
|
|
There is other way for it too.First Execute this query:
select count(*) from yourtable
It always return 1 record and its number of rows in table(at least it return 0 in that record),so you can find out how many records are in the table.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
that is hideously inefficent. i'd just get the EOF thing working.
STL is a religeon. Enquiries to Reverend Christian Graus
|
|
|
|
|
Hi all,
I need to create a short cut to a folder in my VC++ project.
But failed when use the following code
when create a short cut to a file this code work ok.
then how to create a short cut to a folder?
I couldn't find more documents.
Thanks for help.
//////////////////////////////////////
{
HRESULT hResult;
IShellLink * pShellLink;
IPersistFile * pPersistFile;
wchar_t SaveLinkName[MAX_PATH];
::CoInitialize(NULL);
hResult=::CoCreateInstance(CLSID_ShellLink,NULL,CLSCTX_INPROC_SERVER,
IID_IShellLink, (LPVOID FAR*)&pShellLink);
if (SUCCEEDED(hResult))
{
pShellLink->SetDescription(lpDescription);
pShellLink->SetPath(LinkedFileName);
hResult = pShellLink->QueryInterface(IID_IPersistFile,(LPVOID*)&pPersistFile);
if(SUCCEEDED(hResult))
{
MultiByteToWideChar(CP_ACP,0,LinkFileName,-1,SaveLinkName,MAX_PATH);
hResult=pPersistFile->Save(SaveLinkName, TRUE);
pPersistFile->Release();
}
pShellLink->Release();
}
::CoUninitialize();
return hResult;
}
|
|
|
|
|
Hi
I would like to know how to add text to an edit box from a menu link.
I mean... Just like in a HTML Editor. When you click for example, on 'Tags > <br>', this would add the tag <br> where's your cursor at, in your Edit Box.
I would like to have the code for this, because I need it for a project.
All I found, from now on is to store the data into a variable and Set the Window's text to this variable (which is all the text), plus the tag.
You know what that does. It simply adds the tag to the end of my editbox, and I want it at my cursor's position.
Thanks a lot
|
|
|
|
|
have you tried this?
do a SetSel(pos, pos) to position the insert, then use ReplaceSel("<br>") to insert the text
-c
Though the cough, hough and hiccough so unsought would plough me through,
enough that I o'er life's dark lough my thorough course pursue.
--Stuart Kidd
|
|
|
|
|
Are you the same guy who's struggling with CEdit::ReplaceSel?
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Thanks Chris.
Tomasz, I don't know who you're talking of.
|
|
|
|
|
If I got a lot of text in my EditBox, I won't get the <br> tag at the same position than if I have just like 5 lines of HTML code, am I right?
|
|
|
|
|
Hi,
there are days...
well, it works but I think there should be a better way of doing it.
my problem's like this :
I'm passing an array of char (cArray[50][20]) to a function which is declared as MyFunc(char *pArray).
with pArray I'd like to access the array-items, which it does if I increment it by 20, but then it only gives me the first character of each array-item. To correct this, I use strcpy(..) and all goes fine, but to me it looks like a really bad solution.
Someone has an idea to improve this ?
thanks
|
|
|
|
|
Typedef char [50] as a custom type (eg: MyArrayType ) and declare the function argument of type MyArrayType * .
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
And here we go again :
typedef char[50] cArrayType; gives a compile-error.
nontheless thanks
|
|
|
|
|
can you use a CStringArray, or a vector of CStrings?
Though the cough, hough and hiccough so unsought would plough me through,
enough that I o'er life's dark lough my thorough course pursue.
--Stuart Kidd
|
|
|
|
|
thanks for the reply.
the char-array items come from SQLBindCol(....) which wants type char. since
the database-table is about 40 fields large, I use the char array.
After getting all the items filled, I could of course write then to a CString-array but that looks as bad to me as what I've right now.
there should be a way to access the array be incrementing the pointer one step
at a time.
|
|
|
|
|
typedef char cArrayType[50];
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Great !
almost correct, but it must be cArrayType[20]
and now it works like I want it to.
thanks
|
|
|
|
|
Sorry, I assumed you knew what I meant. Try this:
typedef char MyArrayType [50];
MyArrayType myArray [20]; /ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
All-
I just joined this site, because when I get error messages I am often pointed to it during a search. But, I am a virgin when it comes to code. I am getting an error "cannot initialize ressource.dll". I have not installed anything but have lost most of my right-click menu and that error will appear ONCE during every DIFFERENT action. For example: Drag & Drop error, click close and Drag & Drop works without a problem. But, if I get that error with another action AFTER Drag & Drop, then it will reappear the next time I try to drag & Drop.
I do not have ressource.dll on my system and wouldn't know what program it belongs to.
I want to "ease" my way into being able to do simple debugging and I hope this will be the place.
Thanks in advance Mike Mc
|
|
|
|