Do you read
/harbour/contrib/hbfbird/readme.txt
/harbour/contrib/hbfbird/tests
or via rdd please read /harbour/contrib/RDDSQL, specially SDDFB
El 23/09/2010 10:59 a.m., doleynikov escribi�:
Probably we (me and my English experience) are not smart enough.
RDDSQL looks right like what I need, but for the beginning I need
working example: just connect to database and read something.
I have Firebird installed, but I can't make examples from
/harbour/contrib/hbfbird/tests to work. If i try to connect to
existing database - it works somehow, but I can't create database!
Maybe someone could help me from the beginning: what packages should
be installed in UBUNTU? simple .prg with connection to database and
accessing to one field of current record. how to compile (what
libraries to link etc)
I need your assistance! Please, guide me for the few first steps.
2010/9/23 Maurizio Faccio adinet <mau...@adinet.com.uy>:
--
C уважением,
Дмитрий Олейников
harbour/contrib/RDDSQL/sddmy/tests
Please view Createtables function.
You can use RDD to manage a database query, then you manage it like a
DBF, but if you need to CREATE, INSERT, UPTADE, etc in the table within
the engine you should call
RDDINFO(RDDI_EXECUTE, to call SQL statements.
Hope it helps.
STATIC PROC CreateTable()
? RDDINFO(RDDI_EXECUTE, "DROP TABLE country")
? RDDINFO(RDDI_EXECUTE, "CREATE TABLE country (CODE char(3), NAME
char(50), RESIDENTS int(11))")
? RDDINFO(RDDI_EXECUTE, "INSERT INTO country values ('LTU',
'Lithuania', 3369600), ('USA', 'United States of America', 305397000),
('POR', 'Portugal', 10617600), ('POL', 'Poland', 38115967), ('AUS',
'Australia', 21446187), ('FRA', 'France', 64473140), ('RUS', 'Russia',
141900000)")
RETURN
2010/9/24 Maurizio Faccio adinet <mau...@adinet.com.uy>:
--
C уважением,
Дмитрий Олейников
then I changed few first lines of harbour/contrib/hbfbird/tests/simple.prg:
Function main()
Local oServer, oQuery, oRow, i, x, aTables, aStruct, aKey
Local cServer
Local cUser := "sysdba"
Local cPass := "masterkey"
Local nDialect := 3
Local cQuery
local DBpath
ALTD()
DBpath = ("/home/dimao/data/simple.gdb" ) // to be sure that I use
same database everywhere
cServer := "127.0.0.1:" + DBpath
IF hb_FileExists( DBpath )
FErase( DBpath )
ENDIF
? FBCreateDB( DBpath , cuser, cpass, 2048, "ASCII" , nDialect ) //
this line return no errors
? "Connecting..."
oServer := TFBServer():New( cServer, cUser, cPass, nDialect ) //no errors too
IF oServer:NetErr()
? oServer:Error()
QUIT
ENDIF
.......
Probably in linux it's impossible to have 1024 as pagesize.
Finally the program has created a database. there were one error in
other place of code, but the main goal is achieved!
next time I will play with RDD.
2010/9/25 Maurizio Faccio adinet <mau...@adinet.com.uy>:
> --
> You received this message because you are subscribed to the Google
> Groups "Harbour Users" group.
> Unsubscribe: harbour-user...@googlegroups.com
> Web: http://groups.google.com/group/harbour-users
SQLBASE
SQLMIX
DBF
DELIM
SDF
DBFFPT
DBFNTX
DBFNSX
DBFCDX
SIXCDX
DBFBLOB
Unable connect to the server
What to do next? Please help me!
2010/10/10 Dmitry Oleynikov <doley...@gmail.com>:
2010/10/10 Massimo Belgrano <mbel...@deltain.it>:
SQLBASE
SQLMIX
DBF
DELIM
SDF
DBFFPT
DBFNTX
DBFNSX
DBFCDX
SIXCDX
DBFBLOB
.T.
.T.
.T.
.T.
Let's browse table (press any key)
Error SDDFB/1903 Prepare statement failed: SELECT * FROM country (DOS
Error -204)
Called from DBUSEAREA(0)
Called from MAIN(31)
THen I created table manually and just try to browse it -
SQLBASE
SQLMIX
DBF
DELIM
SDF
DBFFPT
DBFNTX
DBFNSX
DBFCDX
SIXCDX
DBFBLOB
Let's browse table (press any key)
Error SDDFB/1903 Prepare statement failed: SELECT * FROM country (DOS
Error -804)
Called from DBUSEAREA(0)
Called from MAIN(31)
Where is mistake?
11 октября 2010 г. 9:33 пользователь Dmitry Oleynikov
<doley...@gmail.com> написал:
dimao@dimao-desktop:~/sources/harbour/contrib/sddfb/tests$ cat test1.prg
/*
* $Id: test1.prg 14222 2010-03-24 09:33:58Z vszakats $
*/
#include "dbinfo.ch"
#include "error.ch"
#include "hbrddsql.ch"
REQUEST SDDFB, SQLMIX
ANNOUNCE RDDSYS
FIELD RESIDENTS
PROCEDURE main()
Local DBpath,DBserver
DBpath='/home/dimao/data/simple.gdb'
DBserver='localhost:' //I tried
127.0.0.1, localhost and just filename for local connection.
ALTD()
RDDSETDEFAULT("SQLMIX")
AEVAL(RDDLIST(), {|X| QOUT(X)})
if hb_FileExists(DBpath)
? "file OK!" // this line shows OK!
ENDIF
IF RDDINFO(RDDI_CONNECT, {"FIREBIRD",, "SYSDBA", "masterkey",
DBserver+DBpath }) == 0
? "Unable connect to the server"
RETURN
ENDIF
CreateTable()
? "Let's browse table (press any key)"
INKEY(0)
? DBUSEAREA( .T.,, "SELECT * FROM country", "country" )
Browse()
? "Let's browse table ordered by resident count (press any key)"
INKEY(0)
INDEX ON RESIDENTS TAG residents TO country
Browse()
DBCLOSEALL()
RETURN
STATIC PROC CreateTable() // DONE MANUALLY
// ? RDDINFO(RDDI_EXECUTE, "DROP TABLE country")
// ? RDDINFO(RDDI_EXECUTE, "CREATE TABLE country (CODE Varchar(5),
NAME Varchar(50), RESIDENTS numeric(10,1))")
// ? RDDINFO(RDDI_EXECUTE, "INSERT INTO country values ('LTU',
'Lithuania', 3369600), ('USA', 'United States of America', 305397000),
('POR', 'Portugal', 10617600), ('POL', 'Poland', 38115967), ('AUS',
'Australia', 21446187), ('FRA', 'France', 64473140), ('RUS', 'Russia',
141900000)")
// ? RDDINFO(RDDI_EXECUTE, "COMMIT")
RETURN
11 октября 2010 г. 14:51 пользователь Massimo Belgrano
<mbel...@deltain.it> написал:
11 октября 2010 г. 15:12 пользователь Dmitry Oleynikov
12 октября 2010 г. 14:05 пользователь Dmitry Oleynikov
14 октября 2010 г. 11:58 пользователь Dmitry Oleynikov