install postgresql with the dev libs find the following files and place in the same folder you are working in
I was going to do somthing with mysql but you need hideous C structs (shudder) and postgresql is *so* easy to use as you can see below!
anyone know how to do a string grid with the gui?!!
libqp.a libpq.dll comerr32.dll libeay32.dll libintl-2.dll krb5_32.dll ssleay32.dll
I was going to do somthing with mysql but you need hideous C structs (shudder) and postgresql is *so* easy to use as you can see below!
anyone know how to do a string grid with the gui?!!
Import "libpq.a" Const CONNECTION_GOOD:Int=0 Const CONNECTION_BAD:Int=1 Const PGRES_TUPLES_OK:Int=2 Extern Function PQconnectdb(s$z) Function PQstatus:Int(conn:Int) Function PQerrorMessage$z(conn:Int) Function PQexec:Int(conn:Int, query_string$z) Function PQresultStatus:Int(res:Int) Function PQclear(res:Int) Function PQfinish(conn:Int) Function PQgetvalue$z(res:Int,i:Int,n:Int) Function PQntuples:Int(res:Int) EndExtern ' assumes a table that will accept ' insert into customers (surname,dob) values ('brown','1971-2-20') Rem -- Table: customers -- DROP TABLE customers; CREATE TABLE customers ( id int8 NOT NULL DEFAULT nextval('customers_id_seq'::regclass), surname text[], dob date, CONSTRAINT "primary key" PRIMARY KEY (id) ) WITHOUT OIDS; ALTER TABLE customers OWNER TO postgres; EndRem conn = PQconnectdb("dbname=test user=postgres password=xxxxxx") If PQstatus(conn) = CONNECTION_BAD Then Print "connection To db failed" Print PQerrorMessage(conn) End EndIf query_string:String="select * from customers" res = PQexec(conn, query_string) If PQresultStatus(res) <> PGRES_TUPLES_OK Then Print "query failed" Print PQerrorMessage(conn) PQclear(res) PQfinish(conn) End EndIf For i = 0 To PQntuples(res)-1 ' /* loop through all rows returned */ line:String="id "+String(PQgetvalue(res, i, 0))+" surname="+String(PQgetvalue(res, i, 2)) line=line+" DOB="+String(PQgetvalue(res, i, 1)) Print line Next PQclear(res) ' /* free result */ PQfinish(conn) ' free connection