PDA

View Full Version : Tip: Connecting the VFP Tables in Lianja using the Sybase ODBC Driver



HankFay
2012-11-03, 17:19
The Sybase Advantage StreamlineSQL ODBC driver is available for Windows in Version 10 for download in the Sybase devzone, here (http://devzone.advantagedatabase.com/dz/content.aspx?Key=20&Release=15&Product=14&Platform=6). A Linux version is also available, here (http://devzone.advantagedatabase.com/dz/content.aspx?Key=20&Release=16&Product=14&Platform=10), but I haven't tested it. In both cases you want the 32-bit version, to be compatible with the App Builder.

In Windows, the following connection string will get you connected to any table, whether it's in a DBC or not:


lcConnStr = [Driver=Advantage StreamlineSQL ODBC; DataDirectory=C:\VPME9APPS\NEXT\SCALEDSARDINE\VERS IONB\XCASE;DefaultType=FoxPro;ServerTypes=1]

From there, you use sqlstringconnect() to be the connection handle:


lnConn = sqlstringconnect(lcConnStr)

And then you can use sqlexec to do your querying:


lnRet=sqlexec(lnConn,"select * from ddrel","myRel")

And yes, for those of you familiar with our xCase2VPM product, this is code being written for xCase2Lianja. xCase2Lianja will be released as Open Source in LianjaX when it's ready to see the light of day.

enjoy,

Hank