Home » Community » Newbie corner » sqlarray and sqlite (Trying to use sqlite example but...)
sqlarray and sqlite [message #54819] |
Fri, 18 September 2020 22:49 |
jimlef
Messages: 90 Registered: September 2020 Location: US
|
Member |
|
|
Hi everyone,
I've been looking over the example for sqlite and these forums, and basically I want to bind my table to the array... When I try to code this, I get "not defined" errors, and I am not seeing where in the example these things were defined other than the schema. I'm lost as to where to move forward here, before adding query functions etc.
My schema:
TABLE (tbl_customers)
INT (id) NOT_NULL PRIMARY_KEY AUTO_INCREMENT
STRING (name, 150) NOT_NULL
STRING (email, 150)
STRING (contact, 150)
STRING (address, 150)
STRING (city, 50)
STRING (state, 20)
STRING (zip, 10)
INT (taxable) NOT_NULL
END_TABLE
My include file:
sqlinclude.h:
#ifndef _Invoices_sqlinclude_h_
#define _Invoices_sqlinclude_h_
#include <SqlCtrl/SqlCtrl.h>
#include <plugin/sqlite3/Sqlite3.h>
#define SCHEMADIALECT <plugin/sqlite3/Sqlite3Schema.h>
#define MODEL "Invoices/Tables/Invoices.sch"
#include <Sql/sch_header.h>
#endif
customers.h:
#ifndef _Invoices_customers_h_
#define _Invoices_customers_h_
#include "Invoices/sqlinclude.h"
struct CustomersWindow : WithCustomersWindowLayout<TopWindow> {
public:
CustomersWindow();
void Paint(Draw& w) {
w.DrawRect(GetSize(), Color(204, 255, 255)); // <= enter your background color here
}
};
#endif
In my layout I have ITEM(SqlArray, CustArray, LeftPosZ(436, 656).TopPosZ(28, 420))
And my cpp code:
#include "Invoices.h"
#include "customers.h"
CustomersWindow::CustomersWindow() {
CtrlLayout(*this, "Customers");
CustArray.SetTable(tbl_customers);
CustArray.AddKey(id);
// CustArray.Join(BOOK_ID, book); // joins id from other db to this id
CustArray.AddColumn(name, "Name"); // .SetConvert(DateIntConvert());
CustArray.AddColumn(email, "Email"); // .SetConvert(DateIntConvert());
CustArray.AddColumn(contact, "Phone");
CustArray.AddColumn(address, "Address");
CustArray.AddColumn(city, "City");
CustArray.AddColumn(state, "State");
CustArray.AddColumn(zip, "Zip");
CustArray.AddColumn(taxable, "Taxable?");
CustArray.ColumnWidths("50 50 20 50 20 15 10 2");
CustArray.SetOrderBy(id);
// CustArray.WhenBar = THISBACK(BorrowMenu);
// CustArray.WhenLeftDouble = THISBACK(EditBorrow);
CustArray.GoEndPostQuery();
}
None of the ids from the schema are recognized, so I have to declare the table another way?
Thank you all for the guidance...
Jim
|
|
|
|
|
sqlarray and sqlite
By: jimlef on Fri, 18 September 2020 22:49
|
|
|
Re: sqlarray and sqlite
By: jimlef on Sat, 19 September 2020 05:50
|
|
|
Re: sqlarray and sqlite
By: jimlef on Sat, 19 September 2020 06:57
|
|
|
Re: sqlarray and sqlite
By: jimlef on Sat, 19 September 2020 08:04
|
|
|
Re: sqlarray and sqlite
By: mirek on Mon, 21 September 2020 08:19
|
|
|
Re: sqlarray and sqlite
By: jimlef on Mon, 21 September 2020 22:54
|
|
|
Re: sqlarray and sqlite
By: jimlef on Tue, 22 September 2020 03:05
|
|
|
Re: sqlarray and sqlite
By: mirek on Tue, 22 September 2020 09:08
|
|
|
Re: sqlarray and sqlite
By: jimlef on Tue, 22 September 2020 17:43
|
|
|
Re: sqlarray and sqlite
By: mirek on Tue, 22 September 2020 17:54
|
|
|
Re: sqlarray and sqlite
By: jimlef on Tue, 22 September 2020 18:07
|
|
|
Re: sqlarray and sqlite
By: mirek on Tue, 22 September 2020 18:47
|
|
|
Re: sqlarray and sqlite
By: jimlef on Tue, 22 September 2020 20:41
|
|
|
Re: sqlarray and sqlite
By: mirek on Wed, 23 September 2020 16:32
|
|
|
Re: sqlarray and sqlite
By: jimlef on Wed, 23 September 2020 17:14
|
|
|
Re: sqlarray and sqlite
By: jimlef on Wed, 23 September 2020 19:57
|
|
|
Re: sqlarray and sqlite
By: jimlef on Thu, 24 September 2020 06:08
|
|
|
Re: sqlarray and sqlite
By: mirek on Thu, 24 September 2020 13:46
|
|
|
Re: sqlarray and sqlite
By: jimlef on Thu, 24 September 2020 16:40
|
|
|
Re: sqlarray and sqlite
By: jimlef on Thu, 24 September 2020 19:28
|
|
|
Re: sqlarray and sqlite
By: mirek on Fri, 02 October 2020 11:40
|
|
|
Re: sqlarray and sqlite
By: jimlef on Fri, 02 October 2020 15:13
|
|
|
Re: sqlarray and sqlite
By: jimlef on Sat, 03 October 2020 00:17
|
|
|
Re: sqlarray and sqlite
By: mirek on Sun, 04 October 2020 10:05
|
|
|
Re: sqlarray and sqlite
By: jimlef on Sun, 04 October 2020 17:27
|
|
|
Re: sqlarray and sqlite
By: mirek on Sun, 04 October 2020 19:56
|
|
|
Re: sqlarray and sqlite
By: jimlef on Sun, 04 October 2020 20:37
|
Goto Forum:
Current Time: Thu May 09 19:26:56 CEST 2024
Total time taken to generate the page: 0.01877 seconds
|