VCXMD with VSRV - Getting Started

Ken Ray kray at sonsothunder.com
Sat Sep 6 13:56:13 CDT 2003


> Here it is:
> 

> 2) I have upload VXCMD Client archives on beta pages.
>     
>     * I have not tests them!
>     * they contains just DLLs of client.
> 
>     * I assume you should be able replace VXCMD dll on Client DLL
>         and all must works.
>     * May be you will need rename VXCMD_Client_xxxxxx to VXCMD_xxxx

You don't have to, so long as you set "the externals" to the proper DLL
name (mine's set to 'VXCMD_Client_MC').

> 3) Note, that for CLIENT you need little redesign you Open() 
> Create() calls Using this methods:
> 
>     dbRef = Database_New( inHost, inUserName, inUserPassword, Port )
>     dbRef = Database_Create( dbPath, Mode, SegmentSize, dbRef )
>     dbRef = Database_Open( dbPath, dbRef )
> 
> At first you MUST create db object by Database_New() then use 
> that dbRef in
> Open() Create() calls.

This is what initially threw me as I was used to "New" meaning "create a
new database" not "create a new connection", but I got it now.
 
> Note, that with Vserver you send NOT Path, but simple DbName 
> as it is known to Vserver.

Here's what I've done so far (note, there's no error checking code yet,
I was walking through line by line in the debugger at this point):

1) Download and install Valentina Server
2) Download Valentina Client and set "the externals" of your stack to
the location of the DLL (as I mentioned above).
3) I moved an already existing Valentina database to the "Databases"
folder in the Valentina Server folder.
4) I "killed" Valentina Server from Terminal by doing "top" and finding
the process ID and doing "sudo kill <pid>"
5) I launched the file "master.vdb" from the "Databases" folder in VAPP
and added one entry for my database ("krdb" as the name, and the path
was "krdb.vdb").
6) I created a test stack with a single button with this code: 

-- Script of a test button:
global gDBRef

on mouseUp
  get Valentina("SetDebugLevel",3)
  get Valentina("Init",20*1024*1024,<your Mac SN>,<your Win SN>)
  put Valentina("Database_New","localhost","sa","sa",15432) into gDBRef
  put Valentina("Database_Open","krdb",gDBRef) into gDBRef
end mouseUp

This all worked. (Yay!) However when I added a line to query the
connected database with something simple:

on mouseUp
  get Valentina("SetDebugLevel",3)
  get Valentina("Init",20*1024*1024,<your Mac SN>,<your Win SN>)
  put Valentina("Database_New","localhost","sa","sa",15432) into gDBRef
  put Valentina("Database_Open","krdb",gDBRef) into gDBRef
  put Valentina("Database_SQLSelectRecords",gDBRef,"SELECT * FROM
Users") into tData
  answer tData
end mouseUp

I get an "ERROR 1020" being returned by Valentina on the
"Database_SQLSelectRecords" line. Any idea why this is happening?

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/ 




More information about the Valentina mailing list