Here's my guess-> you can't do it that way. :grin:
Take a closer look at the code you have there. I'm betting you copied it from B9600486. The only difference is how the JDB_Fetch works on a foreign table. Notice how JDE uses their API to get to columns and not entire rows with data structures:
while ((eJDEDBReturn = JDB_Fetch(hReqDownload_audit, (void *) NULL, FALSE)) == JDEDB_PASSED)
{
/*Get the email column which is number 10 column*/
jdeNIDcpy (dbRef.szTable, "FOREIGN1");
dbRef. idInstance = 0;
jdeNIDcpy (dbRef.szDict, "10");
...
jdeStrcpy(dsKey1F96409.emsuemail, JDB_GetTableColValue (hReqDownload_audit, dbRef), sizeof(dsKey1F96409.emsuemail));
Of interest is the JDB_GetTableColValue using the hRequest and dbRef structure. They don't try to grab a record in a structure pointer passed to JDB_Fetch. Instead, they name table, row and column AFTER the fetch. I'd bet their middleware isn't super dynamic (i.e. does all that work for free), so they rely on some ODBC code to get columns individually with a seperate API. That makes sense to me anyway.
Give their technique a whirl. I bet it works.
Good Luck!