|
Hello,
I have a query regarding recordset retrieval. This is what I have so far.
1.An SDI application(name:Database) without database support and CDatabaseView derived from CFormView
2.A second dialog(name:Dialog1) and its class Cdialog1.
3.A new MFC class CMySet derived fron Crecordset.
4.CDialog1 has a foreign variable m_pSet of type CMySet
The DB connection opens properly using CDatabse.OpenEx()
then i have the following code to open a recordset. "user" is one of the tables I have selected.
CDialog1 dlg;
dlg.m_pSet = new CMySet(m_pDB);
str = "SELECT * FROM User;";
dlg.m_pSet->Open(AFX_DB_USE_DEFAULT_TYPE,str,CRecordset::none)
I get an error at this point, while executing,saying "error retrieving record".Actually on clickin a button on the first main form(which just has a pic) I wanted to have a screen for username and password whiich has to be verified from the DB.
Am i wrong in my approach somewhere. the application builds and compiles jus fine. Kindly help.
|
|
|
|
|
namratab wrote: I get an error at this point, while executing,saying "error retrieving record".
So why don't you step into the Open() call to see what's going on?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
ACtually, the exact same Open call worked in another small aplication. The only difference was that the object invoking the Open() method was of type REcordSEt...and in my case it is of a type MySEt ( derived from recordSEt)
|
|
|
|
|
But until you actually step into the Open() call, you'll not know the cause of the error.
I've only done one article dealing with record sets. See if this is of any help.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
How do I check to see if the 8th bit in a byte is set to a 1 or 0? Thanks
|
|
|
|
|
Use the bitwise '&' operator.
BYTE mybyte = 0x80;
if ( ( mybyte & 0x80 ) != 0x00 )
|
|
|
|
|
|
And I thought it was written for me
|
|
|
|
|
lol, no Mark, you're not a beginner AFAIK. but if you consider yourself to start with bitwise stuff, then yes, you're all understood to bookmark it
|
|
|
|
|
Awww thanks man!
|
|
|
|
|
I'm working on a project which involves printing invoices. Those invoices have predefined layouts (more than one) which may contain tables(of purchased products), images and so on. What should i use for displaying/printing them?. I've used an activex ie control and XML/XSL generated pages for this kind of work in the past but now i need pagination and some other features that html cannot provide. Generating pdf files is also an option but i don't know which api to use
|
|
|
|
|
Straight ASCII and Form Feed characters! :P
Seriously, I would think that something like PDF would work well here, as would something like a reporting package (like Crystal Reports).
There are APIs that allow you to programmatically create a PDF document, but I do not know of any free ones.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
there are some but...well...i need something more than a txt2pdf thing
|
|
|
|
|
Hi,
Please help me find a way to disable or change the color of the selection highlighting in a CTreeCtrl. It is the same selection highlighting that is expanded by enabling the "FullRowSelect" option of a CTreeCtrl.
Thanks.
|
|
|
|
|
Hi,
I try to translate text to text in True DBGrid control, but it seems not work in VC++, my code list below:
....
CValueItems oValueItems;
oValueItems = m_CtrlTDBG.GetColumns().GetItem(&index).GetValueItems();
CValueItemDisp* pValueItemDisp = new CValueItemDisp();
pValueItemDisp->SetValue(old_value);
pValueItemDisp->SetDisplayValue(new_value);
oValueItems.Add((LPDISPATCH)pValueItemDisp);
oValueItems.SetTranslate(TRUE);
....
I don't know how to use the function CValueItems.Add(LPDISPATCH vItem), someone can give me any suggestion? Thanks!
|
|
|
|
|
liur17 wrote: I don't know how to use the function CValueItems.Add(LPDISPATCH vItem), someone can give me any suggestion? Thanks!
what type of TrueDB grid are using.... UnBounded or bounded
"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
Support CRY- Child Relief and you
|
|
|
|
|
Thanks for your reply.
I use True OLE DataGrid 7, using bound mode.
Looking forward to your instruction, Thank you in advance.
|
|
|
|
|
Hello !
I want to find out whether the current logged in user is Domain user or a Local system user. What I mean Is whether user is logged to Domain or a local system.
Is there any API I can use to determine this???
Thanks.
|
|
|
|
|
sach!! wrote:
Is there any API I can use to determine this???
Possibly. Check out NetUserGetInfo() and NetWkstaUserGetInfo() .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi !
Thanks for the reply..
I am using NetUserGetInfo() to get the user information and SID.
I used LookupAccountSid() to get the domain name.
Now if user is Local user, domain name will be local machine name and if he is a domain user then domain name will be set accordingly.
But how to determine this as domain-name and machine name can be same..
Thank u.
|
|
|
|
|
sach!! wrote: But how to determine this as domain-name and machine name can be same..
What do USER_INFO_2.usri2_logon_server and WKSTA_USER_INFO_1.wkui1_logon_server indicate in that situation?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I believe that you can use ::GetUserNameEx(...) with a name format parameter of NameSamCompatible . That format will reutrn the username in DOMAIN\USERNAME format, and I believe that if you are logged in locally, the DOMAIN portion will be the Computer Name (See ::GetComputerName(...) /::GetComputerNameEx(...) for the computer name).
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Hi, I'm displaying a Property Sheet (3 tabs) and whenever I select the tab I need the first time, my sheet displays correctly. However, subsequent selections do not display properly. Is there a way to force a OnInitialize() operation on the form again? Maybe something like an invalidate - though, I am programming in MFC.
|
|
|
|
|
Like2Byte wrote: However, subsequent selections do not display properly.
Which means what?
Like2Byte wrote: Is there a way to force a OnInitialize() operation...
What version of VC++ are you using? With v6, property pages use OnSetActive() when the page becomes active.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi all,
i want to convert CString to LPCSTR.
/=====================================
CString str = "Hellow this is a Text";
LPCSTR result[150];
-->how we get the str value in result ?.
i.e result = "Hellow this is a Text".
//====================================
Please let me know if any solution for this. its urgent for me
Uday kiran
|
|
|
|