|
|
Home » U++ Library support » U++ SQL » error in example/SQLApp [FIXED]
error in example/SQLApp [FIXED] [message #5706] |
Tue, 10 October 2006 17:29  |
 |
forlano
Messages: 1207 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
Hello,
today is not my day. All SQL stuff does not work. Even the SQLApp has problem. Am I missing something?
Luigi
==================================
query.cpp
C:\upp\uppsrc\CtrlLib/EditCtrl.h(130) : error C2248: 'Ctrl::operator =' : cannot access private member declared in
class 'Ctrl'
C:\upp\uppsrc\CtrlCore/CtrlCore.h(260) : see declaration of 'Ctrl::operator ='
C:\upp\uppsrc\CtrlCore/CtrlCore.h(190) : see declaration of 'Ctrl'
This diagnostic occurred in the compiler generated function 'EditField &EditField::operator =(EditField &)
'
SQLApp: 1 file(s) built in (0:02.43), 2438 msecs / file, duration = 2453 msecs
[Updated on: Mon, 30 October 2006 09:45] Report message to a moderator
|
|
|
|
|
|
|
|
Re: error in example/SQLApp [message #13730 is a reply to message #6063] |
Fri, 25 January 2008 07:42   |
|
I found One small error in SQLApp.
In file book.cpp, line 35, I change
SQL * dlg.ctrls.Update(BOOK);
with code
SQL * dlg.ctrls.Update(BOOK).Where(ID == q);
Without this, I can't be able to change BOOK table.
And Now question. I found error, or I don't understand Ultimate SQL teñhnique ???
Thanks.
SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
|
|
|
|
Re: error in example/SQLApp [message #13733 is a reply to message #13731] |
Fri, 25 January 2008 11:00   |
|
Thanks. And Sorry for my English.
Now (this time) I try to understand technique (or technology) of life with UPP and I have additional time to analize expamples.
I found this TOOL is interest and powerful.
And I found one more strange thing in this example.
File borrow.cpp, lines from 14 to 27 - Function
Value DateIntConvertCls::Scan(const Value& text) const
{
String txt = text;
if(IsNull(txt))
return Null;
Date d;
if(StrToDate(d, txt)) {
const char *s = txt;
while(*s == ' ') s++;
if(*s == '\0')
return d - Date(1970, 1, 1);
}
return ErrorValue("Invalid date!");
}
I add there one string return d - Date(1970, 1, 1);.
Value DateIntConvertCls::Scan(const Value& text) const
{
String txt = text;
if(IsNull(txt))
return Null;
Date d;
if(StrToDate(d, txt)) {
const char *s = txt;
while(*s == ' ') s++;
if(*s == '\0')
return d - Date(1970, 1, 1);
}
return d - Date(1970, 1, 1);
// ^^^^^^^^^^^^^^^^^^^^^^^^^
return ErrorValue("Invalid date!");
}
Without this string, I can't to edit Date fields, when I add borrow records. I can add only empty dates.
This may be my mistake or mistake of program.
SQLApp - is a complex example, because many of newbies see to this application and this application is face of system.
And this app must be a exapmle of stability ( ).
SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
[Updated on: Fri, 25 January 2008 18:46] Report message to a moderator
|
|
|
Re: error in example/SQLApp [message #13755 is a reply to message #13733] |
Fri, 25 January 2008 23:16   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
sergeynikitin wrote on Fri, 25 January 2008 05:00 | Thanks. And Sorry for my English.
Now (this time) I try to understand technique (or technology) of life with UPP and I have additional time to analize expamples.
I found this TOOL is interest and powerful.
And I found one more strange thing in this example.
File borrow.cpp, lines from 14 to 27 - Function
Value DateIntConvertCls::Scan(const Value& text) const
{
String txt = text;
if(IsNull(txt))
return Null;
Date d;
if(StrToDate(d, txt)) {
const char *s = txt;
while(*s == ' ') s++;
if(*s == '\0')
return d - Date(1970, 1, 1);
}
return ErrorValue("Invalid date!");
}
I add there one string return d - Date(1970, 1, 1);.
Value DateIntConvertCls::Scan(const Value& text) const
{
String txt = text;
if(IsNull(txt))
return Null;
Date d;
if(StrToDate(d, txt)) {
const char *s = txt;
while(*s == ' ') s++;
if(*s == '\0')
return d - Date(1970, 1, 1);
}
return d - Date(1970, 1, 1);
// ^^^^^^^^^^^^^^^^^^^^^^^^^
return ErrorValue("Invalid date!");
}
Without this string, I can't to edit Date fields, when I add borrow records. I can add only empty dates.
This may be my mistake or mistake of program.
SQLApp - is a complex example, because many of newbies see to this application and this application is face of system.
And this app must be a exapmle of stability ( ).
|
Stupid me. That is the price to pay when you are overengineering the code, and not test it enough in the same time...
Value DateIntConvertCls::Scan(const Value& text) const
{
String txt = text;
if(IsNull(txt))
return Null;
Date d;
if(StrToDate(d, txt))
return d - Date(1970, 1, 1);
return ErrorValue("Invalid date!");
}
Thanks!
Mirek
|
|
|
|
|
Re: error in example/SQLApp [message #13760 is a reply to message #13759] |
Sat, 26 January 2008 01:39   |
|
One more small question.
Of course, I can find the answer himself.
In russian standarts Date fields must start from day, followed by month, and at end must be year. And .(period) must be as divider.
(for example 29.12.2008)
May be exist ready solution to make Date Entry field under our standards.
Thanks.
SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
|
|
|
|
|
|
Re: error in example/SQLApp [message #13853 is a reply to message #13829] |
Wed, 30 January 2008 00:39   |
|
All the works. Regarding translatings, I am still in the process of learning. I have a lot of plans for the programming in environment TheIDE. As a result, there is a lot of translations, which I will publish.
SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
|
|
|
|
Re: error in example/SQLApp [message #13964 is a reply to message #13963] |
Mon, 04 February 2008 00:22   |
|
.... continued previous message
I think.
A code should look something like this.
void SQLApp::Query()
{
SqlBool where;
SqlSet borrowed = Select(BOOK_ID).From(BORROW_RECORD).Where(IsNull(RETURNED));
int q_date_from = ~query.date_from - Date(1970, 1, 1); // <== NEW
int q_date_to = ~query.date_to - Date(1970, 1, 1); // <== NEW
if(query.status == 1)
where = ID != borrowed;
if(query.status == 2)
where = ID == borrowed;
SqlBool bdate;
if(!IsNull(query.borrowed_from))
// bdate = BORROWED >= ~query.borrowed_from;
bdate = BORROWED >= q_borrowed_from; // <== NEW
if(!IsNull(query.borrowed_to))
// bdate = BORROWED <= ~query.borrowed_to;
bdate = BORROWED <= q_borrowed_to; // <== NEW
if(!bdate.IsEmpty())
where = where && ID == Select(BOOK_ID).From(BORROW_RECORD).Where(bdate);
book.Query(where);
}
SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
|
|
|
|
Goto Forum:
Current Time: Mon Apr 28 20:32:37 CEST 2025
Total time taken to generate the page: 0.04230 seconds
|
|
|