PDA

View Full Version : DSNLess connection to Lianja Sql Server



Phjr
2013-08-05, 04:39
Hi, can connect with following data source
[LianjaDemo]
Driver = Lianja
DATABASE = ODBC:RECITAL:SERVERNAME=10.231.92.232;USERNAME=?;P ASSWORD=?;DATABASE=southwind;

isql test
[root@lnxdev ~]# isql -v lianjademo
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL> select count(1) from employees
+-----------+
| Count(1) |
+-----------+
| 9 |
+-----------+
SQLRowCount returns 1
1 rows fetched
SQL>

Connecting from console with following connection string fails (Lianja Sql Server and App builder on Linux)
lcDSNLess='DRIVER=Lianja ODBC Driver;SERVER=10.231.92.232;DATABASE=southwind;Uid =?;Pwd=?;'

lnConnHandle=SQLSTRINGCONNECT(lcDSNLess)
if lnConnHandle > 0
sqlexec(lnConnHandle,"select count(*) from employees")
list
sqldisconnect(lnConnHandle)
else
messagebox("connection failed")
endif

what would be missing or wrong?
Regards

yvonne.milne
2013-08-05, 05:32
Hi,

Try this:


lcDSNLess='DRIVER=Lianja;SERVER=10.231.92.232;DATA BASE=southwind;Uid =?;Pwd=?;'

The Driver on Linux is installed in odbcinst.ini with the name 'Lianja', which is why your DSN works: 'Driver = Lianja'.

I will get the documentation updated to show the difference between the Linux and Windows DSNless connections.

Thanks for pointing this out,

Yvonne

Phjr
2013-08-05, 07:10
Its ok now, thanks