|
That is soooo true ! And something that is even worse is when you ask the guy for more informations and never get an answer. This is really totally selfish !
Hum, wait, even better: when the guy doesn't answer you but deletes his first message when he got his answer
|
|
|
|
|
|
v2.0 wrote: hey, i'm not selfish...
I don't get you . I was speaking of people who are asking questions and once they have the answer to their questions, they delete their first message. Did you do something like that ?
|
|
|
|
|
yup, you didn't get me...
i said "doh", for such kind of guys...
and i said also "i'm not selfish" myself,, and so delivered you 2 '5' votes
|
|
|
|
|
Ok, it's the morning so my brain needs to wake up
|
|
|
|
|
Cedric Moonen wrote: Ok, it's the morning so my brain needs to wake up
ok, '1' for you :-> hey dude, i'm joking !
|
|
|
|
|
Hi,
some sample code for read data from xls file.
CDatabase database;
CString sSql;
CString Name, Address;
CString sDriver;
CString sDsn;
CString sFile = "c:\\kdr.xls"; // the file name. Could also be something like C:\\Sheets\\WhatDoIKnow.xls
// Clear the contents of the listbox
m_List.ResetContent();
// Retrieve the name of the Excel driver. This is
// necessary because Microsoft tends to use language
// specific names like "Microsoft Excel Driver (*.xls)" versus
// "Microsoft Excel Treiber (*.xls)"
sDriver = GetExcelDriver();
if( sDriver.IsEmpty() )
{
// Blast! We didn´t find that driver!
AfxMessageBox("No Excel ODBC driver found");
return;
}
// Create a pseudo DSN including the name of the Driver and the Excel file
// so we don´t have to have an explicit DSN installed in our ODBC admin
sDsn.Format("ODBC;DRIVER={%s};DSN='';DBQ=%s",sDriver,sFile);
TRY
{
// Open the database using the former created pseudo DSN
// sSql = "INSERT INTO demo (Name,Address) VALUES ('Nilesh','Pune')";
// database.ExecuteSQL(sSql);
database.Open(NULL,false,false,sDsn);
// Allocate the recordset
CRecordset recset( &database );
// Build the SQL string
// Remember to name a section of data in the Excel sheet using "Insert->Names" to be
// able to work with the data like you would with a table in a "real" database. There
// may be more than one table contained in a worksheet.
sSql = "SELECT Name, Address "
"FROM demo "
"ORDER BY field_1";
// Execute that query (implicitly by opening the recordset)
recset.Open(CRecordset::forwardOnly,sSql);//,CRecordset::readOnly);
// m_List.AddString( Name + " --> "+Address );
// recset.Open(NULL,sSql,NULL);
// Browse the result
// while( !recset.IsEOF() )
// {
// Read the result line
recset.GetFieldValue("field_1",Name);
recset.GetFieldValue("field_2",Address);
// Insert result into the list
// m_List.AddString( Name + " --> "+Address );
// Skip to the next resultline
recset.MoveNext();
// }
// Close the database
database.Close();
}
CATCH(CDBException, e)
{
// A database exception occured. Pop out the details...
AfxMessageBox("Database error: "+e->m_strError);
}
END_CATCH;
}
problem occur after
recset.Open(CRecordset::forwardOnly,sSql);//,CRecordset::readOnly);
it is not enter into condition. go to catch and throw error
Database error : To few parameters expected 2. why this error occur. pls give me where I am wrong in code.
my aim is when I click on Read button, display data from file. kindly give me a reply.
regards
kedar
Girish
Software Developer
|
|
|
|
|
vcforums wrote: sSql = "SELECT Name, Address "
"FROM demo "
"ORDER BY field_1";
I suspect that this is your problem. I see where you selected into the demo table the Name and Address but there is no mention of a "field_1". If the field that is in your SQL select statement does not exist, then you will get that "too few parameters" error. Make sure that all of the fields exist in the database that you are trying to read.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
|
|
|
|
|
hi all,
how to acess messages from MSMQ Events when message arrived from source to Destination in OnArrived() function.
thanks,
uday.
uday kiran
|
|
|
|
|
I've got a console project, just console.cpp; stdafx.cpp; stdafx.h
Then something happend to it and breakpoints started to appear randomly in the code after launching it in debug mode.
I've cleaned solution and rebuilded it, useless.
Now I deteleted Debug and Release dirs, deleted *.ncb; *.sln; *.suo files and loaded project again. Useless, launch it in debug and thats it! breakpoints start to appear randomly. Ahhhhh....
9ine
|
|
|
|
|
I have no idea what is wrong with your system - have you ruled out a hardware problem? Are any other applications or your system affected?
Have you run a virus/spyware checker recently?
[I cannot stand people that vote on something without providing feedback when their vote may not be obvious. I cannot imagine any intelligent reason to vote your post a "3"...]
Peace!
-=- James 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! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Nothing in Quarantine folder.
None of my application are affected and everything works fine.
The only changes I've done in Tools->Options->TextEditor->C/C++->Tabs
changed tab size from 4 to 2. resulted in indentation in source code shifted.
returned it back from 2 to 4 to get original indentation
9ine
|
|
|
|
|
|
9ine wrote: ...breakpoints started to appear randomly in the code...
I've seen this several times with VC++ v6.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I have to create transparent static text in an ATL Composite Control.
I did map WM_CTLCOLORSTATIC & WM_CTLCOLORDLG messages like
MESSAGE_HANDLER(WM_CTLCOLORSTATIC, OnCtlColorStatic)
MESSAGE_HANDLER(WM_CTLCOLORDLG, OnCtlColorStatic)
LRESULT OnCtlColorStatic(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled )
{
bHandled = TRUE;
SetBkMode((HDC) wParam, TRANSPARENT);
return (LRESULT)GetStockObject(HOLLOW_BRUSH);;
}
But the Static Text not become transprent. What should I do? ( This is a non MFC ActiveX)
( When I called ::SetBkColor((HDC) wParam, RGB(0,0,255)); from this function, the bg color changed)
Any hints will be great help
|
|
|
|
|
There are a lot of example on how to hook keyboard and mouse, but i still can't find an example about hooking serial communication..
Could someone help me?
|
|
|
|
|
Hi!
I have a multiple page tab with clistctrl in each page.
When I toggle to different tab page, i dont want to see any selected item in clistctrl.
If i select items in list control in the first tab for example, and then go the second tab, when i go back to first tab, no items should still be selected.
how to do that? please help
|
|
|
|
|
I think you have to deselect those elements when you switch the tab. Windows can do it for you. Sorry!
|
|
|
|
|
MFC: In OnActivate(), Deselect all items of the CListCtrl.
~RaGE();
|
|
|
|
|
lorey wrote: ...i dont want to see any selected item in clistctrl.
Use the CListCtrl::SetItem() method.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
...monsocket.cpp(4) : fatal error C1853: 'Debug/reseaup.pch' is not a precompiled header file created with this compiler
-> help me pleaaaassee !!
what should i do this time ?
thankssssssssss
|
|
|
|
|
aren't you compiling with a different compiler from Visual C++ ?
delete the .pch file, and/or disable the precompiled headers in the project settings
|
|
|
|
|
Hi all
I'm looking forward to purchase ExeCryptor (www.strongbit.com) to protect my shareware written in C++. But before I'd like to know independent opinions/experience if any.
My question is: Anybody uses execryptor? Can you tell me smth about? Are there some problems? Is it cost-effective?
Thank you in advance for any reply
Jean
|
|
|
|
|
hello everybody .. i think that it's a stupid question but i need answer thanks my problem is as defined :
//this is my constructor ... in a class
<bold>
varstr= new char[0];
but when i do :
<bold>
cout <<strlen(varstr);< bold=""> it returns : 4
so i need that it returns 0 !!
thank you again
A C++ illetrate
|
|
|
|
|
try this: cout <<strlen(*varstr); - it might work just fine for you. Good luck!
P.S. strlen(varstr); it will always return 4 bytes since it's an ADDRESS
|
|
|
|