git-svn-id: svn://ultimatepp.org/upp/trunk@906 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2009-02-26 11:03:34 +00:00
parent 7614df545f
commit ab65cba3d8
5 changed files with 44 additions and 8 deletions

View file

@ -37,20 +37,20 @@ GUI_APP_MAIN
r.DrawText(x, y, String(ch, 1) + String(cl, 1), fnt);
}
r.NewPage();
for(int i = 0; i < 10; i++) {
for(int i = 0; i < 18; i++) {
int a, b;
do {
a = Random(100) + 1;
b = Random(100) + 1;
}
while(a + b < 0 || a + b > 100);
r.DrawText(10, 10 + 3 * isz.cy / 2 * i, Format("%d + %d =", a, b), fnt);
do {
a = Random(50) + 1;
b = Random(50) + 1;
}
while(a + b < 0 || a + b > 50);
r.DrawText(10, 10 + isz.cy * 2 * i, Format("%d + %d = ", a, b), fnt);
do {
a = Random(30) + 1;
b = Random(20) + 1;
}
while(a - b < 1);
r.DrawText(2000, 10 + isz.cy * 2 * i, Format("%d - %d = ", a, b), fnt);
r.DrawText(2000, 10 + 3 * isz.cy / 2 * i, Format("%d - %d =", a, b), fnt);
}
Perform(r);
}

5
upptst/odbctst/init Normal file
View file

@ -0,0 +1,5 @@
#ifndef _odbctst_icpp_init_stub
#define _odbctst_icpp_init_stub
#include "Core/init"
#include "ODBC/init"
#endif

View file

@ -0,0 +1,21 @@
#include <ODBC/ODBC.h>
using namespace Upp;
CONSOLE_APP_MAIN
{
ODBCSession session;
session.Connect("DRIVER=SQL Server Native Client 10.0;SERVER=QUAD\\SQLEXPRESS;DATABASE=Holly;UID=test;PWD=koblih;");
LOG("Connected!");
SQL = session;
Sql sql;
sql.Execute("select ID, TEXT, SINCE, TILL from SUBJECT_ATTR where SINCE > ?", Date(2009, 2, 20));
// sql.Execute("select ID, TEXT, SINCE, TILL from SUBJECT_ATTR where ID > ?", 1700);
while(sql.Fetch()) {
for(int i = 0; i < sql.GetColumns(); i++) {
const SqlColumnInfo& f = sql.GetColumnInfo(i);
LOG(f.name << '=' << sql[i]);
}
}
}

View file

@ -0,0 +1,10 @@
uses
Core,
ODBC;
file
odbctst.cpp;
mainconfig
"" = "";

View file