Home » Developing U++ » UppHub » Am I doing something wrong, or is there a bug? FIREBIRD
Am I doing something wrong, or is there a bug? FIREBIRD [message #49491] |
Sat, 17 February 2018 19:20  |
|
Hi all-
I am on my 4 day weekend
I am using a very recent nightly U++ build with MinGW and windows Firebird 3.0.3.x.
I am spending it checking out if this is possible with Firebird.
Here is the code I am trying to test...
It outputs this error:
C:\cygwin64\home\mtdew\theide\upp/uppsrc/Sql/Sqls.h:437:14: error: expected ';' before 'AppCursor'
#define SQL AppCursor()
^
C:\cygwin64\home\mtdew\theide\upp/uppsrc/Sql/Sqls.h:437:14: note: in definition of macro 'SQL'
#define SQL AppCursor()
^~~~~~~~~
I will include the code that I tried to adapt from tutorials i found.
Please let me know if it looks okay or not. I am not sure if it will work.
I figured I'd give it a try. thx- mtdewq
#ifndef _fbtest1_fbtest1_h_
#define _fbtest1_fbtest1_h_
#include <CtrlLib/CtrlLib.h>
#include <SqlCtrl/SqlCtrl.h>
using namespace Upp;
#define LAYOUTFILE <fbtest1/fb.lay>
#include <CtrlCore/lay.h>
#include <Firebird/Firebird.h>
#define SCHEMADIALECT <Firebird/FirebirdSchema.h>
#define MODEL <fbtest1/database.sch>
#include "Sql/sch_header.h"
// debian: sudo apt-get install libpq-dev
class FirebirdTest : public WithFirebirdTestLayout<TopWindow> {
public:
typedef FirebirdTest CLASSNAME;
FirebirdTest();
bool OpenDB();
//bool InsertTestData();
void ShowTestData();
protected:
FBSession m_session;
};
#endif
#include "Firebird/Firebird.h"
#include "fbtest1.h"
#include <Sql/sch_schema.h>
#include <Sql/sch_source.h>
using namespace Upp;
bool FirebirdTest::OpenDB()
{
m_session.Connect(
"C:/Program Files/Firebird/Firebird_3_0/examples/empbuild/employee.fdb",
"localhost",
"SYSDBA",
"MASTERKEY"
);
m_array.SetSession(m_session);
SQL = m_session;
SqlSchema sch(m_session);
All_Tables(sch);
SqlPerformScript(sch.Upgrade());
SqlPerformScript(sch.Attributes())
SQL.ClearError();
return true;
}
FirebirdTest::FirebirdTest()
{
CtrlLayout(*this, "Firebird Test");
m_refresh <<= THISBACK(ShowTestData);
m_array.SetTable(COUNTRY);
m_array.AddColumn(COUNTRY_COUNTRY, "Country");
m_array.AddColumn(COUNTRY_COUNTRY, "Currency");
}
void FirebirdTest::ShowTestData()
{
// m_array.SetOrderBy(TESTPARTNER_NAME);
m_array.Query();
}
GUI_APP_MAIN
{
FirebirdTest dlg;
if(dlg.OpenDB() )
{
dlg.ShowTestData();
dlg.Run();
}
}
TABLE_(COUNTRY)
STRING_ (COUNTRY_COUNTRY,15)
STRING_ (COUNTRY_CURRENCY,10)
END_TABLE
LAYOUT(FirebirdTestLayout, 416, 348)
ITEM(SqlArray, m_array, HSizePosZ(8, 88).VSizePosZ(8, )
ITEM(Button, m_refresh, SetLabel(t_("Refresh")).Tip(t_("Refresh data in array")).RightPosZ(8, 72).TopPosZ(8, 24))
END_LAYOUT
[Updated on: Sat, 17 February 2018 20:08] Report message to a moderator
|
|
|
Re: Am I doing something wrong, or is there a bug? FIREBIRD [message #49538 is a reply to message #49491] |
Sun, 25 February 2018 10:14  |
|
Hi-
I spent a little time fooling around in U++ today. I am going to work on grid and arrayctrl stuff with the examples and firebird to practice. I am not sure if it can be used with sqlarray, but I don't care right now. I can still practice with the other controls while I am learning.
I need to just practice in general anyway with U++ and firebird at the moment.
It is going to be cool.
Have a cool week.
mtdew3q
|
|
|
Goto Forum:
Current Time: Fri Apr 25 19:09:15 CEST 2025
Total time taken to generate the page: 0.00801 seconds
|