V4MD : Connecting to a local DB AND to a server DB possible ?

Ruslan Zasukhin sunshine at public.kherson.ua
Tue Aug 14 10:56:41 CDT 2007


On 14/8/07 5:14 PM, "Steven Ophalvens" <silversoft at skynet.be> wrote:

> The problem is that I need to use 2 different databases :
> - 1 located on a server
> - 1 located on the users computer containing multimedia material
> This means that I need to do both a .initClient() and an .init() on
> My valentina object to be able to work with both kinds of databases.
> 
> The problem is that as soon as I do the .init() call, any connection
> Objects that I create after that point, can not be successfully opened,
> because I get an invalid login/pass error, which certainly is not the case.
> If I remove the .init() call, opening connections to the server db
> works everytime, but then I can not access the local DB.
> 
> Anyway, I only need 1 connection to the server database, but I think I
> Wrote that I 'reused' it, when I meant that I .close() it after I have
> Worked with it and open() it when I need it again.
> So I think that 1 Instance of a connection object that is opened/closed
> at the right time should be enough for me.

Actually picture of calls must be

1) init engine

    Valentina.Init()
    Valentina .InitClient

2) init connections

    gConn = new(Xtra "VConnection", "localhost", "sa", "sa" )


MANY TIME you can do:

   gConn.Open()
        db1 = new VDatabase
        db1 ....

   gConn.Close()  -- all objects of this connection DEAD now


3) for local dbs you do just

    db2 = new Xtra Vdatabse ...
    db2.Create or open
        ...
    db2.Close


4) and when you done you do

    Valentina. Shutdown()
    Valentina.ShutdownClient


So you must NOT call Init many times as you say


-- 
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 mailing list