[Gambas-user] Connecting to Postgres (was Q in an event keypress header)

richard terry rterry at ...1822...
Fri Jan 11 03:27:28 CET 2008


Firstly I'd subclass your requests in different emails so as to not mix up 
topics as above otherwise in the long run no-one will know about the content - 
ie the header won't reflect the content.

I'm assuming you want something basic, so with reference to your database 
thingy, here's a few lines of code to connect to an existing progress 
database with obviously postmaster running.

It is essentially the same as the code in the database example except  that 
the parameters are for postgres. You can get the rest of the code from the 
example.  If you are already past that stage then I'll pass you on to more 
knowledgeable others.



PRIVATE FUNCTION make_connection() AS Boolean
  

          WITH conn
                    .Type = "postgresql"
                    .Host = "localhost"
                    .Login = "yourlogon"
                    .Password = "your password"
                    .Name = "yourdatabasename"
          END WITH 

          TRY conn.OPEN 
          IF ERROR THEN 
                    Message("Cannot open database. Error = " & Error.Text)
                              RETURN FALSE
          END IF
          RETURN TRUE
END 

> hi all,
>
> I am trying to use gambas. Please help me about code to resolve my problem
> 1. How to move cursor when I press key enter on keyboard ?
> 2. How to fill data from database (as a postgres database server) to
> gridview or table view. ?
>
> Regards
> Gunartha
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplac
>e _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user




More information about the User mailing list