|
wow he ask repeated
|
|
|
|
|
You have two realistic options.
1 - go somewhere that you can pay someone to write this for you
2 - start to listen to what people tell you, answer what they ask you, and allow yourself to be guided to a solution.
Bravoone_2006 wrote: *please show me an example !
We really cannot. We still need to know how you're connecting to the database. We really need to know what part of this you're having trouble with. Do you not know any SQL ? Have you considered learning some in the time you've instead spent asking this over and over in this forum ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
ok i have try to read something but i dont understand thats way i need an example , and is for me ONLY not for money for money i do something else not programing i am hardware engineer not software !
and i want to make a program for me and i dont no . 4 hours ago i found this solution because i have try to find a solution for 2 months who can pay you 2 months to do nothing ???????
My database is on to another computer i named server !
Server ->
my computer :
ODBC -> My program !
(VisualFoxPro 6.0 database )(driver) name : "Name_City" <-on ODBC
and i still need help ! because i dont have a choice !
Bravoone
|
|
|
|
|
OK, so you're using ODBC to FoxPro ( it's coming back to me now ). You must know how to pass SQL to your database, because you're already retrieving data, right ?
The text in your CEdit box can be retrieved using GetWindowText. Then, it will be in a CString, which you can use to build your SQL query.
CString SQL = "Select * from tblName where field = '" + str + "'"
Where tblName is the table, field is the field in the table, and str is the CString you filled with GetWindowText.
That your database is on another PC is irrelevant to your ability to pass the SQL string through to it. I was more asking if you're using ADO, DAO, etc.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
i m not use ado,dao !
i will test what you say !
tanks !
Bravoone
|
|
|
|
|
No worries. If you substitute the right terms in that SQL, it will work.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
i have done this :
void CNcontabile::OnChangeName()
{
CString sCod ,csFoundCity;
CDatabase_1BunView1* pBun = new CDatabase_1BunView1();
if (!pBun->Open())
return;
if (pBun->IsOpen())
{
CString SQL = "Select * from tblName where field = '" + sCod + "'";
while(!pBun->IsEOF())
{
m_name.GetWindowText(sCod);
m_city.SetWindowText(SQL);
}
}
pBun->Close();
}
but its not work !
i have try to make this in database ! but only were can let me is : edit stored procedure in visualfoxpro 6.0 were i have the database
: Select * from tblName where field = '" + sCod + "'
but is not work were is wrong ?
Bravoone
|
|
|
|
|
|
I"m sorry, there's a fundamental problem here, which I doubt anyone can solve. You appear not to have heard anything I said, and just hoped for a magic bullet that you could put in your code without any thought at all.
Bravoone_2006 wrote: if (!pBun->Open())
return;
if (pBun->IsOpen())
Isn't this redundant ?
Bravoone_2006 wrote: CString SQL = "Select * from tblName where field = '" + sCod + "'";
1 - I told you at least twice you needed to change the names to reflect the actual names in your database
2 - you have failed to assign any value to sCod, despite being told several times by several people over several days how to do so
Bravoone_2006 wrote:
while(!pBun->IsEOF())
{
m_name.GetWindowText(sCod);
m_city.SetWindowText(SQL);
}
I'm sorry, but I've helped a lot of people over a lot of years, I've never been this speechless. I'd love to help you, but I really don't think it's possible. I'd advocate paying someone to write this code for you, or giving up on C++ and learning VB.NET.
I honestly mean that.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I can no longer contain myself...
Yes I am on the floor laughing!
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Bravoone_2006 wrote: CString SQL = "Select * from tblName where field = '" + sCod + "'";
Is your database/recordset supposed to magically see this?
What type of object is CDatabase_1BunView1 ?
Bravoone_2006 wrote: while(!pBun->IsEOF())
When does this loop ever terminate? Typically you'd need some sort of "move next" statement.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I think he needs to learning sql
|
|
|
|
|
I did suggest that in the first place.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
lets see : i dont want to learn SQL only to work this thats it , way to learn SQL ... only for this ? what is the ... only need help for this thats all !
can you help me with this?
Bravoone
|
|
|
|
|
Its not true if you learn sql it will helpful for you and you want to write a database program so you need to know things about sql
|
|
|
|
|
I'm sorry, I've spent days trying to help you, and you've not listened to anything I've said, provided information I need, taken my advice, or shown in the code that you've posted that your skills are up to doing anything remotely this complex. We're here to help, but if the person on the other end is unable to understand our help, there's really nothing we can do.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I want to write a proram to download the mails automatically.
First connect the server,second login,and then caculate the total number of the mails,the last receive the mail one by one.
When I caculate the number,the result is incorrect(the result is -858993460). Why and how to caculate the nubmber of the mail? How the mail stored and how to distinguish the different mails.Whether some characters between the different mails.
Thank you for reading and answer my question.
My account is in yahoo
help
|
|
|
|
|
when i can use
winsock/winsock2 OR
CSocket/CAsynsSocket
|
|
|
|
|
Muhammad Azeem Azam wrote: winsock/winsock2
Windows Sockets 2 is designed for use by C/C++ programmers.
Run-Time Requirements
Windows Sockets 2 can be used on all Windows platforms.
Muhammad Azeem Azam wrote: CSocket/CAsynsSocket
Class CSocket derives from CAsyncSocket and inherits its encapsulation of the Windows Sockets API. A CSocket object represents a higher level of abstraction of the Windows Sockets API than that of a CAsyncSocket object. CSocket works with classes CSocketFile and CArchive to manage the sending and receiving of data.
This is an MFC approach to use Sockets. User's working on C/C++ and WIN32 applications can use winsock etc...
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Good Morning,
I have 99 CEdit I want to do a loop and pick
the text of there 99 text and concatenate them in
a Cstring here an exemlpe
for (i=0;i<=99;i++)
allString=allString + the content of CEdit[i].the function to extract the text;
I found an exemple on VB
For i = 0 To 99
HolayString = HolayString & txtHol(i).CtlText
Next i
how i do it in VC++
thanks a lot
zzzzz zizzz
|
|
|
|
|
Supposing you have created a dialog based application with 99 edit box ( Use Microsoft App wizard for creating Dialog based App)
Then suppose there is a button on the dialog and on clicking you need the 99 text. Then handle the BN_CLICKED event of the button
CMYDlg::OnButton1()
{
CString MyStr;
For( i = 0; i<=99; i++ )
{
MyStr += EditArray[i].GetWindowText(); //Supposing the CEdit EditAray[99] is declared and created.
}
AfxMessageBox( MyStr );
}
Rinu Raj
|
|
|
|
|
few remarks :
1) you dont construct the EditArray
2) you don't initialize MyStr
3) it should be for, not For
4) GetWindowText() don't work that way
otherwise, the concept is good
|
|
|
|
|
thank you for pointing
i haven't executed the code
Please consider it as a suggestion
Thanks
Rinu Raj
|
|
|
|
|
you can do 3 ways :
(1) common way. you have a variable for each edit, and access it with m_edit.GetWindowText(strContent) . you do that for each and then you Create a CString which is a concatenation of all of them... quite hard to do !
(2) brute way. you ensure that ever editBoxes IDs are following each others (like IDC_EDIT1 == 1001, IDC_EDIT2 == 1002, etc...). then, you can make a for loop from IDC_EDIT1 to IDC_EDIT99, read their content and contatenate like in (1).
(3) more Subtle solution. you create a list (std::vector will do) with references to the 99 editboxes. the only matter is that they are puched in the correct order in the list so that you read them good. then you do this :
std::vector<UINT> vec;
vec.push_back(IDC_EDIT1);
vec.push_back(IDC_EDIT2);
CString strAll = _T(""), strItem = _T("");
std::vector<UINT>::iterator iter;
for (iter = vec.begin(); iter != vec.end(); iter++) {
GetDlgItem(*iter)->GetWindowText(strItem);
strAll += strItem;
}
|
|
|
|
|
The IDC_EDIT as value or as Control
|
|
|
|