Don ---
No more verbose message? Try going into the DSN and modifying it to show alert messages and see what you get then.
>Sorry, the results is that while trying to issue
>
>lnOk = sqlprepare( lnHandle, lcStatement, lcAlias )
>
>lnOk comes back = -1.... SQL cant understand the statement
>
>
>>Don ---
>>
>>What, exactly, is the problem?
>>
>>>I have a problem with a select statement... I don't know if its ODBC driver or what...
>>>
>>>Before executing a statement sent via ODBC, I copy the value into a temp table for later analysis so I can track down errors but can't find any with the following sample. If I paste the command in the ISQL window and execute, it works no problem....
>>>
>>>
>>>select
>>> TmpTran = XProcID.ta_transno,
>>> XProcID.ta_procID,
>>> XDiagID.ta_catid,
>>> Cats2.ca_epidays,
>>> Cats2.ca_cap,
>>> Cats2.ca_fySnap,
>>> BadCat = case
>>> when XDiagID.ta_catid = Cats2.category
>>> then ' '
>>> else
>>> '*'
>>> end
>>> into
>>> tempdb.dbo.tmpjoin1
>>> from
>>> tempdb.dbo.XProcID,
>>> tempdb.dbo.XDiagID
>>> left outer join tempdb.dbo.cats2
>>> on XDiagID.ta_catid = Cats2.category
>>> where
>>> XProcID.ta_transno = XDiagID.ta_transno
>>>
>>>
>>>
>>>Any input would be appreciated... This is really getting to be a PITA since it is not consistent (results). The tables are only 2-3 fields each, and only 300,000 records (small data size) and I have the tempdb database allocated for over 1 GIG of space so I know that isn't the problem...
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05