0x80040e14 error
I'm trying to query a linked server, but I keep getting an error back every time with the number in the subject. Here's the full error message:
(1) [Microsoft][ODBC SQL Server Driver][SQL Server][OLE/DB provider returned message:[MERANT][ODBC PROGRESS driver][PROGRESS]Syntax error (7587)]
(2) [Microsoft][ODBC SQL Server Driver][SQL Server][OLE DB error trace[OLE/DB Provider 'MSDASQL' CommandPrepare::Prepare returned 0x80040e14]
And here's the line that's causing it:
SELECT \"Sales-Agent-Name\" \"saname\" FROM OPENQUERY(SANJMIS,'SELECT \"Sales-Agent-Name\" FROM [PUB.sales-agent] WHERE\"Sales-agent-id\" = (SELECT \"Sales-Rep-ID\" FROM PUB.Job WHERE \"Job-ID\"= ''" + Field( 'Job Number' ) + "'') ')
The problem (I think) is coming from [PUB.sales-agent]. It gave me a similar error without the []'s, and after looking around the net I came across several sites that said 'put []'s around it'. Still doesn't work. Without the []'s it only returns the second error.
Any thoughts?
*edit* - should have put this in the SQL Server section...
|