|
Monty2 wrote: pSet->GetRecordCount();//something like this
This will simply give you the “high water mark” — the highest-numbered record yet seen as the user moves through the records.
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
Yeah - I know. That's why I need another solution...
Is there another way to get the number of records in a recordset other than going through the recordset with a loop or using COUNT?
-- modified at 9:23 Tuesday 16th May, 2006
|
|
|
|
|
SWDevil wrote: Is there another way to get the number of records in a recordset other than going through the recordset with a loop or using COUNT?
Have you considered/tried a stored procedure?
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
Ummmm - no. don't really know what that is...
|
|
|
|
|
|
Thanks - I'll look at the links
|
|
|
|
|
SWDevil wrote: Is there another way to get the number of records in a recordset?
You can use JOINs with the COUNT() clause. Simply put COUNT() around the columns that you are querying.
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
I tried doing that (in SQL server) and it doesn't work...
|
|
|
|
|
Ok, so just use COUNT(*), leaving the JOIN and WHERE clauses intact.
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
Hi All,
I know that the compile options \Gh gets you the _penter and _pexit, which can be used to get function level timings.
However, now the trick is how does one get to the level of saying: Line 121 took 13ms, Line 122 took 14ms, etc...?
Has anyone got any ideas or documentation to read?
thanks,
Rich
"Programming today is a race between software engineers striving to build bigger and
better idiot-proof programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook
|
|
|
|
|
hi all,
I have a video Player.Everytime the video player open and plays a video file,the corresponding files should be stored in folder.
1.how can i create a folder automatically.
If i give Filename=c:\\Folder1,I got error.
Please help me
cheers
sangeet
|
|
|
|
|
ramyasangeet wrote: If i give Filename=c:\\Folder1,I got error.
That's not very clear. What are you doing with Filename, post some code ('If I give' is quite vague). And what error did you get ?
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
Hi,
Thanks for the reply.
This is my coding.
CFile cf;<br />
CString filename;<br />
int xu_flag;<br />
CString s; <br />
if(i == 1)<br />
{ <br />
s.Format("%d", (xu_picno/2)+1);<br />
filename = "c:\\temp\\";<br />
filename+=s;<br />
filename+="F";<br />
filename+=".jpg";<br />
}<br />
else<br />
{<br />
s.Format("%d", (xu_picno/2)+1);<br />
filename = "c:\\temp\\"; <br />
filename+=s;<br />
filename+="R";<br />
filename+=".jpg";<br />
<br />
}<br />
xu_flag = cf.Open(filename, CFile::modeCreate | CFile::modeWrite);<br />
cf.Write(sp_temp, xu_len); <br />
cf.Close();
This coding is for storing each frame of video file in jpeg format.Using Xu_picno, i can able to retrive pictures.So everytime the pic no changes,the filename will also change.Like 1F,2F...
My problem is ,i have to store those picture in seperate folders.
So i need to create folder in runtime.how to do that.
help me please
cheers
sangeet
|
|
|
|
|
You can't create folder with CFile.
Use the _mkdir[^] function for that purpose.
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
ramyasangeet wrote: s.Format("%d", (xu_picno/2)+1);
filename = "c:\\temp\\";
filename+=s;
filename+="F";
filename+=".jpg";
Why not use:
filename.Format("c:\\temp\\%dF.jpg", (xu_picno/2)+1);
ramyasangeet wrote: xu_flag = cf.Open(filename, CFile::modeCreate | CFile::modeWrite);
cf.Write(sp_temp, xu_len);
If the call to Open() fails, there's no need to call Write() or Close().
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
and CreateDirectory
whitesky
|
|
|
|
|
can u please give me an example.
Also do i need to declare _mkdir??
help me out
cheers
sangeet
|
|
|
|
|
ramyasangeet wrote: Also do i need to declare _mkdir??
What do you mean ?? You simply need to call this function with the name of the folder you want to create. Did you read the doc from the MSDN (the link I sent you) ? It's pretty obvious how to use it. Also, don't forget to include <direct.h> (also stated in the doc).
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
I suggest that you read msdn
CreateDirectory("c:\\test",NULL);
whitesky
|
|
|
|
|
in www.msdn.com
CreateDirectory
This function creates a new directory
_mkdir
Create a new directory.
WhiteSky
|
|
|
|
|
thanks for ur reply.
I used the create directory function.
CreateDirectory("c:\\test\\",NULL);
To create another folder named front in the test folder,i used the same method.
CreateDirectory("c:\\test\\front",NULL); ,the folder is not creating..any other way to create subdirectories??
Also i have to store jpeg files in the created subdirectory.
How to do that.
cheers
sangeet
|
|
|
|
|
you can use each name instead test use your favorite name
like this
CopyFile("c:\\a.bmp","d:\\a.bmp",1);
whitesky
|
|
|
|
|
ramyasangeet wrote: CreateDirectory("c:\\test\\front",NULL); ,the folder is not creating..any other way to create subdirectories??
try SHFileOperation api or http://www.codeproject.com/shell/cshellfileop.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
ramyasangeet wrote: CreateDirectory("c:\\test\\front",NULL); ,the folder is not creating..
Are you sure that the c:\test folder exists? If it doesn't, CreateDirectory() will fail.
Why are you not checking the return value from GetLastError() ?
"The largest fire starts but with the smallest spark." - David Crow
|
|
|
|
|
I would like to know how to control the charactor spacing in the CEdit control? Please help!
|
|
|
|