Re [VREPORTS]: Postgre Connection String

Ruslan Zasukhin ruslan_zasukhin at valentina-db.com
Wed Nov 28 16:03:36 CST 2012


On 28/11/2012 23:08, "Tim Seyfarth" <tjs at global-electronics.com> wrote:

Hi Tim,

> Ruslan,
> 
> I found in your wiki a small section on the PostgreSQL connection
> string.  Unfortunately I cannot get it to work.  The compiler is
> erroring on the VConnection call saying that Paramters are not
> compatible with this function.
> 
> Can you please tell me the correct syntax?
> Thank you
> 
>    Dim host as string = "localhost"
>    Dim Port As integer = 5432
>    Dim dbName As String = "...."
>    Dim user As String = "....."
>    Dim pw As String = "............"
> 
>    Valentina.InitClient()
>    //postgresql://     host=127.0.0.1, port=5432, dbname=db1, user=sa,
> password=sa, timeout=0
>    connection = New VConnection( host, port, dbName, user, pw, 0)

No no no.

1) Valentina.InitClient() is to init Valentina Client.
 to be able then connect to VSERVER.

But you want reports with PostgreSQL.
So not needed.


2) You need check 
        V4RB/Examples/Vreport/SQLite


It is very simialr to what you need
Just instead  specify PATH to SQLite db
You need specify postgresql connection string.




3) Simple code:

    Valentina.InitReports()   -- you need init reports

    .... Here open .vsp file


  // Produce datasource-string
  dim ds_str as string = "postgresql://host=localhost, port=5432,dbname=db1,
user=sa, pasword=sa, timeout=0"
  
  mReport = mProject.MakeNewReport(
                        reportIndex + 1,
                        ds_str ,
                        "SELECT * FROM T1"  )



4) your mistake above is that you made many strings.
But it is SINGLE string.


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina-beta mailing list