|
The pointer itself may be shared among processes, but the data it points to is not. Use shared memory for that, check out CreateFileMapping() and MapViewOfFile()
|
|
|
|
|
Because this error \"SQL:Statement too long"\ i must write an SQL statement for 3 columns , because when i say CRecordset pSet;
pSet.Update(); The cause of this error ! (Update) because he is try to update all columns in my table , i have 400.000 records !
all i want is to Edit a field pSet.Edit();
My SQL statement is too long , but i dont write an SQL statement how can i short him ? or how can i write an SQL statement to retrieve just 3 columns from my table , please help me !?!?
Bravoone
|
|
|
|
|
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Do not feed the troll ! - Common proverb
|
|
|
|
|
I think you must read a sql book else you can not write a good program
|
|
|
|
|
You've failed to provide sufficient enough information for a meaningful answer. Have you derived class from CRecordset ? What does it look like? What does the code look like that opens the database and/or record set? What does the code look like that calls Edit() and Update() methods? The more relevant code that you omit from your post, the less help you're apt to receive.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
void CNoteDlg::OnSalveazaCr()
{
CWaitCursor wait; // Display a wait cursor
for(int i=0; i<m_list.getitemcount();i++)
{
="" if(m_list.getcheck(i))
="" {
="" cstring="" stemp,stemp1,stemp2,stip1,stip2,stest1,sanul1,
="" sluna,sluna1,sziua1,sdata;
="" cmainspace="" *pmainspace="new" cmainspace;
="" pmainspace-="">m_sTextDatabase.Empty();
pMainSpace->m_sTextDatabase1.Empty();
pMainSpace->m_sTextDatabase2.Empty();
pMainSpace->m_sTextDatabase3.Empty();
m_cod.GetWindowText(pMainSpace->m_sTextDatabase);
pMainSpace->m_sTextDatabase.TrimLeft();
pMainSpace->m_sTextDatabase.TrimRight();
m_nrNota.GetWindowText(pMainSpace->m_sTextDatabase1);
pMainSpace->m_sTextDatabase.TrimLeft();
pMainSpace->m_sTextDatabase.TrimRight();
m_datanota.GetWindowText(sLuna1);
m_datanota3.GetWindowText(sZiua1);
m_datanota1.GetWindowText(sAnul1);
pMainSpace->m_sTextDatabase3 = m_list.GetItemText(i,22);
pMainSpace->m_sTextDatabase2 = sLuna1 + "/" + sZiua1 + "/" + sAnul1;
CDatabase_Note pBun;
pBun.m_strFilter="note1="+ pMainSpace->m_sTextDatabase;
pBun.m_strFilter="note2="+ pMainSpace->m_sTextDatabase1;
pBun.m_strFilter="note3="+ pMainSpace->m_sTextDatabase3;
pBun.Open();
pBun.Edit();
while (!pBun.IsEOF())
{
int nIndexA = pBun.m_note1.Find(pMainSpace->m_sTextDatabase);
int nIndexB = pBun.m_note2.Find(pMainSpace->m_sTextDatabase1);
if ((nIndexA != -1) & (nIndexB != -1))
{
pBun.Edit();
pMainSpace->m_sTextDatabase3 = m_list.GetItemText(i,22);
pBun.m_note2 = pMainSpace->m_sTextDatabase3;
pBun.Update();
pBun.Close();
delete pMainSpace;
break;
}
//while
}
m_list.DeleteItem(i);
i--;
}
}
}
this is my code ... but somethig is wrong because it say SQL: Statement too long ! what can i do !
please help me !
i will wait your answer !
because i dont have one !
Bravoone
|
|
|
|
|
Bravoone_2006 wrote: for(int i=0; i<m_list.GetItemCount();i++)
...
i--;
Notice anything wrong with this?
Bravoone_2006 wrote: CMainSpace *pMainSpace = new CMainSpace;
It is not necessary to make this a pointer. Remove the new and delete calls.
Bravoone_2006 wrote: pMainSpace->m_sTextDatabase.Empty();
pMainSpace->m_sTextDatabase1.Empty();
pMainSpace->m_sTextDatabase2.Empty();
pMainSpace->m_sTextDatabase3.Empty();
The calls to Empty() are not necessary.
Bravoone_2006 wrote: while (!pBun.IsEOF())
I do not see anything in the while loop that is advancing the pBun object to the next record. Have you ensured that the while loop terminates.
Aside from the logic errors, what exactly are you trying to accomplish here?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
All i want is to Edit some fields !
How? i have done what you say but no change !
... how can i terminate the while loop , and where i must do in while pBun.MoveNext();?
Bravoone
|
|
|
|
|
Bravoone_2006 wrote: How? i have done what you say but no change !
None of my suggestions had anything to do with "editing fields." I would suggest posting your modified code snippet (please use the <pre> tags for this), and the results it is producing.
Bravoone_2006 wrote: how can i terminate the while loop ,
What is the while loop supposed to be doing?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
How long does a SQL statement have to be to be too long? 64K? 1MB?
Do you have 400,000 records or 400,000 columns?
I guess the real question is - How many times are you going to ask this question without providing
any information so someone can try to help you?
|
|
|
|
|
1MB? and I think you guess is right
|
|
|
|
|
Hello together!
I run a hexapod / stewart platform, which receives its position data from a computer that acts as a server. I have put up a direct LAN connection (100Mbit/s) between this host and the computer on which we will run all the simulation software for our project. I want to transmitt the new position data (36 bytes)every 5 or better every 2 ms. Therefor I planed to use UDP and I used some code I found here. By now the packets I sent only arrive seperately if I transmitt the packets with 100Hz. A higher pulse seems not possible. I already changed the MTU to 70....
If you please have any hint...
Thanks a lot and kind regards.
Oli
|
|
|
|
|
kletteroli wrote: By now the packets I sent only arrive seperately if I transmitt the packets with 100Hz.
Huh? And if you send them faster they arrive how? Why change the MTU? You should easily be able
to send this data using UDP (even TCP).
Something's up in your communication code.
|
|
|
|
|
I want to add items between two dates.I used CTime class to find the two dates(current and past). i want to add the list of url's i opened that range of time.Everything is fine but how can we make the condition on times for ex: for or while or if etc
|
|
|
|
|
CTime has normal add and compare operators, so you can loop on a CTime the same way you would do with an integer.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
Do not feed the troll ! - Common proverb
|
|
|
|
|
CTime CurTime = CTime::GetCurrentTime();
CString sTime1,sHour,sTime2;
sTime1.Format("%d/%d/%d",CurTime.GetYear(),CurTime.GetMonth(),CurTime.GetDay());
sTime2.Format"%d/%d/%d", .......);
m_time1.SetWindowText(sTime1);
m_time2.SetWindowText(sTime2);
if(sTime1 > sTime2)
{
//Do something
//lets say m_time3.SetWindowText("Real time");
}
UpdateData(FALSE);
Bravoone
|
|
|
|
|
I have converted file time to system time using the function,
FileTimeToSystemTime(&suURL.ftLastVisited,&st);
Now can i get the time in CTime from the above line.I am able to display the string value for that particular systemtime.otherwise how can we convert CString to CTime.
Thanks
|
|
|
|
|
radhika28 wrote: otherwise how can we convert CString to CTime.
If the time is in a standard format, use COleDateTime::ParseDateTime() . The CTime class is too limiting.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Is there a VC++ equivalent to the Visual Basic "CStr" keyword?
dharani
|
|
|
|
|
You may use CString::Format for this purpose.
|
|
|
|
|
For s = 1 To 10
rec(s) = " #" & CStr(rs2(0)) & CStr(rs2(1))
msg4 = msg4 & rec(s)
rs2.MoveNext
Next s
how can i convert this in VC++?
dharani
|
|
|
|
|
For s = 1 To 10
rec(s) = " #" & CStr(rs2(0)) & CStr(rs2(1))
msg4 = msg4 & rec(s)
rs2.MoveNext
Next s
where rs is a recordset which has only two columns..
dharani
|
|
|
|
|
dharani_3d wrote: rec(s) = " #" & CStr(rs2(0)) & CStr(rs2(1))
What does, rs2(0),rs2(2) would return ?
Say its returning int.
In that case,
you use.
CString sTemp;
sTemp.Format(_T("%d%d"),rs2(0),rs2(1));
|
|
|
|
|
There's not a direct replacement for it because CStr() returns a different value depending on the type of value sent to it. For example, it might return True/False if the value is Boolean , or a short date if the value is a Date .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hello everybody,
Is there any possiblity to declare a variable as a Variant and a Variant array?
for example in VB, we can declare
Dim rec(80) As Variant //array
Dim msg As Variant
Is there any possibility to declare like this Visual C++?
Likewise in VB,
'msg' which holds some variant value and I can display it in text box.
Text1.Text = msg3
How can I display the variant value in edit box?
Please reply me.. thanks in advance.
Dharani
|
|
|
|