composing connection string for ODBC

Bernard Devlin revolution at
Sat Oct 26 16:57:01 EDT 2002

Hi Bob,
Thanks for helping out... I spent hours trying to figure this out before I
asked for help. 

But it looks like the problem was right in front of my eyes - I just couldn't
see it (literally!)

There was a return in the field where the variable Dsn was getting its value
from.  When this came up in the Answer dialog, I was just assuming that the
answer dialog was wrapping the text (duh! see my later remark on longevity)
When I actually used the debugger, I could inspect the values of the variables.
Finally I could see that the Dsn was not recognized.

However, it didn't help that the error message that was returned was not
displayed by Rev.  I could see the error dialog flash up, but it was only there
for a microsecond.

One thing I have learned in working with Rev, is that what seems like an error
from the engine or Transcript is 99.9% of the time not the case.  I think it is
one of the fantastic things about Rev having it's basis in Metacard (and
Hypertalk) is that the longevity of the language and engine have been honed.
I'm sure that the bug in the error dialog that means that it only stays there for
a second will also be removed (I presume that this is something in Rev itself).

I have never had so much pleasure working with any language or development
environment in over 20 years :-)) 

> >     get revdb_connect(DbType,Dsn,,Username,thePassword)
> >     --get revdb_connect("ODBC","ibXTGLocal",,"aUser","aPassword")
> >
> > If I perform the connection with the commented code it works.
> >
> > The answer command shows "ODBC","ibXTGLocal",,"aUser","aPassword".
> >
> > BUT... the connection fails if the connect string consists of the variables
> > rather than the literal strings.  This is the case even if I remove the '&
> > quote' constants from the values inserted into the variables.
> >
> > Any suggestions why my code does not work?
> I tripped over this one myself a while back.  Check the Transcript dictionary and
> you'll see that revdb_connect() requires variable *names*, not variables.  Pretty
> subtle.

More information about the use-livecode mailing list