Open Database on Server

Bart Pietercil bart.pietercil at gmail.com
Mon Oct 29 13:59:59 CDT 2007


Hi Beatrix,

a quick one because of feeling equally dense (by the flu)


from the constructor of my ValDB Class

Sub Constructor(isServer as Boolean= FALSE, host As string = "",port  
As Integer = 15432)
   // Calling the overridden superclass constructor.
   // Note that this may need modifications if there are multiple  
constructor choices.
   // Possible constructor calls:
   // VDatabase(inStorageType As Integer=0) -- From VDatabase
   // VDatabase(inConnection As VConnection) -- From VDatabase



   Valentina.Init(3*1024*1024,"serials")

   Try
     if isServer Then

       Dim myConnection As VConnection
       Dim mySRV As VServer

       myConnection  = New VConnection(host,"user","password",port, 
10,"embedded_server_string(required for embedded server)")

       myConnection.Open()


       if  myConnection.IsConnected Then
         Super.VDatabase(myConnection)
       end if

     Else
       Super.VDatabase
     end if
   Catch Err As VException
     MsgBox("Error in Create ValDB: " + Err.Message)
   end Try


End Sub


And then a call to this

Function OpenServerDB(DBName As String) As Boolean
   Dim f As FolderItem

   f = GetFolderItem(DBName)
   Try
     Open(f)
     Return True
   Catch Err as VException
     MsgBox("Error while Opening ServerDB: " + Err.Message)
     Return False
   end Try
End Function


hth

Bart



On 29-okt-07, at 19:08, Beatrix Willius wrote:

> Hello,
>
> I'm feeling very dense today, but I can't seem to figure out how to  
> open a database on a server. For the client I have
>
>     ValentinaDB = new VDatabase
>     ValentinaDB.open(theFolderitem)
>
> where theFolderitem is the folderitem pointing to the local  
> database. For the server I have
>
>   dim theConnection as VConnection
>   dim theServer as VServer
>   theConnection = New VConnection(theHost, theUser, thePassword,  
> thePort, 0, "")
>   theConnection.Open()
>   theServer = new VServer(theConnection)
>
> but what do I afterwards?
>
> ValentinaDB = new VDatabase(theConnection)
>
> only has the connection as parameter and not a name. Using Mac OS  
> 10.4.7 on G5 with RB2007r3 and V4RB3.4, VServer 3.4.
>
> Thanks in advance for your help.
>
>
>
>
> Mit freundlichen Grüßen/Regards
>
> Trixi Willius
>
> http://www.mothsoftware.com
> Mail Archiver X: archive, clean and search email
> http://www.beatrixwillius.de
> Fractals, 3d landscapes etc.
>
> _______________________________________________
> Valentina mailing list
> Valentina at lists.macserve.net
> http://lists.macserve.net/mailman/listinfo/valentina



More information about the Valentina mailing list