Beginning Valentina Question

Ken Ray kray at sonsothunder.com
Sat Nov 29 13:25:18 EST 2003


Dan,

I've done a lot of stuff with Valentina, although I have stayed away
from using Rev's "wrapper" around Valentina calls and I connect
directly. Here's the basic process:

1) Initialize the connection to Valentina. This is done through a call
like this:

    get Valentina("Init",<cacheSize>,<macSerial>,<winSerial>)

If you get back nothing, you have a successful connection. If you get
back a string that contains "ERROR", you don't.

2) Open a specific database:

    get Valentina("Database_Open",<pathToDB>)

This returns a database reference number ("DBRef") that you use from
this point on to address the database.

Rev wraps both #1 and #2 in the call to "revOpenDatabase", and returns
the DBRef to as a result of the function. So if you are getting nothing
back when making a call to "revOpenDatabase", then it is not connecting
properly. 

Once you have a good connection (i.e. a DBRef), you can then do a simple
test. Assuming you had a table called "Software", you could do:

  put Valentina("Database_SQLSelectRecords",<DBRef>,"SELECT * FROM
Software")

... if you were using Valentina directly, or:

  put revQueryDatabase(<DBRef>,"SELECT * FROM Software")

... if you use Rev's wrapper.

I was the one that originally developed the Software DB Demo, but at
that time (Rev 1.1) it was developed with an ODBC connection and was
later changed to support Valentina. It is possible that the demo is out
of date and needs to be fixed. 

Just my 2 cents,

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

> -----Original Message-----
> From: use-revolution-bounces at lists.runrev.com 
> [mailto:use-revolution-bounces at lists.runrev.com] On Behalf Of 
> Dan Shafer
> Sent: Saturday, November 29, 2003 2:12 AM
> To: How to use Revolution
> Subject: Re: Beginning Valentina Question
> 
> 
> Thanks, Mark, but it appears to me that the problem probably lies in 
> Revolution's sample stacks. Neither of the database samples 
> works when 
> used with Valentina.
> 
> I visited the valentina site and found a reference to the 
> issue of what 
> is returned when a Valentina DB is opened. According to the 
> post I read 
> there, the docs are wrong in indicating that an integer is returned 
> from a valid database opening. Rather, an empty value returned 
> indicates success. So I changed the appropriate line in the script to 
> look for empty rather than not a number. Now the software DB 
> demo loads 
> correctly without an error dialog but any attempt to add a 
> new software 
> item generates a new error dialog indicating a connection error.
> 
> I don't know how one is supposed to work through this kind of thing 
> with documentation that is wrong or missing or, worst of all, 
> contradictory. But apparently a lot of folks have gotten Valentina 
> databases working with Revolution. So maybe it's the demos that are 
> wrong rather than the revolution interface. Maybe the demos 
> are out of 
> date and need updating or fixing.
> 
> Anyway, I'm giving up trying to get the demos to work and seeing if I 
> can figure out how to get *any* SQL command to execute in Valentina. 
> This feels like skating on very thin ice. When the tools 
> don't work as 
> advertised, everything in programming becomes a crap shoot.
> 
> On Nov 28, 2003, at 9:05 PM, Mark Brownell wrote:
> 
> >
> > On Friday, November 28, 2003, at 08:30  PM, Dan Shafer wrote:
> >>  Where is this simple stuff located?
> >>
> >> I'm trying to create a tutorial on how to print reports from a
> >> Valentina database but what I thought would be the easy part -- 
> >> connecting to a Valentina DB -- is turning out to be 
> excruciatingly 
> >> difficult.
> >
> > I would ask for any help on the Valentina mailing list.
> >
> > Send Valentina mailing list submissions to
> > 	valentina at lists.macserve.net
> >
> > To subscribe or unsubscribe via the World Wide Web, visit
> > 	http://lists.macserve.net/mailman/listinfo/valentina
> > or, via email, send a message with subject or body 'help' to
> > 	valentina-request at lists.macserve.net
> >
> > You can reach the person managing the list at
> > 	valentina-owner at lists.macserve.net
> >
> >
> > _______________________________________________
> > use-revolution mailing list
> > use-revolution at lists.runrev.com 
> > http://lists.runrev.com/mailman/listinfo/use-revolution
> >
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com 
> http://lists.runrev.com/mailman/listinfo/use-> revolution
> 




More information about the use-livecode mailing list