[Gambas-user] hConnection = New Connection ( [ DatabaseURL As String ] )

Fabien Bodard gambas.fr at ...626...
Tue Aug 27 09:42:25 CEST 2013


And then if you configure the connection ide you can use :


Connections["Connection1"].Open()


2013/8/26 Tobias Boege <taboege at ...626...>

> On Mon, 26 Aug 2013, Bruce wrote:
> > What syntax for "DatabaseURL As String"?
> >
> > I'm trying to create a connection to an SQLite db in a different gambas
> > project source directory:
> >
> >         $conn = New
> >
> Connection("/share/projects/gambas3_proj/horse/horseBO/.connection/bometa.connection")
> >
> > (and various other path strings to the connection definition).
> >
> > All I get is "Malformed URL" error.
> >
>
> >From the sources, I deduce the following format (and it works here):
>
> $TYPE://$USER@$HOST:$PORT/$DB
>
> where the :$PORT part is optional.
>
> So to connect to something like
>
> hConn = New Connection
> With hConn
>   .Type = "mysql"
>   .Login = "root"
>   .Password = "toor"
>   .Host = "localhost"
>   .Port = 3306
>   .Name = "test"
>   .Open()
> End With
>
> you could write
>
> hConn = New Connection("mysql://root@...40...:3306/test")
> hConn.Passwort = "toor"
> hConn.Open()
>
> Regards,
> Tobi
>
>
> ------------------------------------------------------------------------------
> Introducing Performance Central, a new site from SourceForge and
> AppDynamics. Performance Central is your source for news, insights,
> analysis and resources for efficient Application Performance Management.
> Visit us today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48897511&iu=/4140/ostg.clktrk
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



-- 
Fabien Bodard



More information about the User mailing list