composing connection string for ODBC

Bernard Devlin revolution at knowledgeworks.plus.com
Mon Oct 21 10:50:01 EDT 2002


Trying to make my ODBC connection strings dynamically modifiable, but I have a
problem.


Here's the code

    put quote & the text of button btnDbType & quote into DbType
    put quote & the text of field fdDsn & quote into Dsn
    put quote & the text of field fdUsername & quote into Username
    put quote & the cpPassword of field fdDsn & quote into thePassword
    answer DbType,Dsn,Username,thePassword
    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?



More information about the Use-livecode mailing list