Colleagues,
"The battle rages on" (I. Gillan, DP 1993) with that DB2 thingy. While I am able to establish a connection with the source database (thanks to Cetin's help last week), attempts to pull out the data from a table in that database fail misearbly for yours truly. So, "I don't ask for any special treatment/But I wouldn't mind a hand" (P. McCartney in "Rough Ride", "Flowers in the Dirt", 1989).
Here's the code, see comments:
lcConnStr = "Driver={IBM DB2 ODBC DRIVER};Database=" + tcDB + ;
";Hostname=Host.Addr.com;Protocol=TCPIP;Port=xxxxxx;Uid=UserID;Pwd=UPW;"
lnConnPtr = lnConnHndl = SQLSTRINGCONNECT(lcConnStr, .T.) && This part works
IF lnConnPtr >= 0
lcSQL = [SELECT * FROM SOME_TABLE INTO CURSOR C_TABLE NOFILTER READWRITE]
lnRet = SQLEXEC(lnConnPtr, lcSQL) && This one doesn't
IF lnRet < 0 && Can't pull out the data
WAIT WINDOW NOWAIT NOCLEAR [ Can't pull out the data ]
ENDIF (lnRet < 0 && Can't pull out the data)
ENDIF (lnConnPtr >= 0)
That "Can't pull out the data" banner is being displayed always, indicating that no rows were pulled out.
What might cause this behavior? (Meaning what to look at/for.) Or, more generic one:
What am I possibly doing wrong?
Regards,
Ilya