Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Syntax Error

Status
Not open for further replies.

seanybravo

IS-IT--Management
Sep 24, 2003
89
GB
Hello

I was wondering if someone could help me why this SQL Statement is giving me a syntax error? I have one that is simualr that works fine.

The only difference I can see between the on that works is that I am not using the SELECT * statement could this make a difference?

Thanks

SQL--

SELECT * FROM tblData LEFT JOIN (SELECT * FROM tblTitle IN 'E:\Websites\ebusinessdirectories\Database\Admin.mdb') ON tblData.fldContactTitle = tblTitle.fldTitleID ORDER BY fldCompanyName

ERROR --

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error in JOIN operation.
 
And what about this ?
SELECT tblData.*, tblTitle.*
FROM tblData
LEFT JOIN tblTitle IN 'E:\Websites\ebusinessdirectories\Database\Admin.mdb'
ON tblData.fldContactTitle = tblTitle.fldTitleID
ORDER BY tblData.fldCompanyName

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks for you response

This query will work:

SELECT tblData.fldCompanyName, tblData.fldContactTitle FROM tblData LEFT JOIN (SELECT * FROM tblTitle IN 'E:\Websites\ebusinessdirectories\Database\Admin.mdb') AS tblTitle ON tblData.fldContactTitle = tblTitle.fldTitleID ORDER BY fldCompanyName

But if I add the tblData.* and tblTitle.* to it I get the following error. Any Ideas? I had a quick look on the net and have put MDAC 2.6.2 on but the error still remains. Its for a asp page connecting to an access database. I would rather use the * wildcard as some of the fields may change.

ERROR:

Microsoft Cursor Engine error '80004005'

Data provider or other service returned an E_FAIL status.
 
Sorted

Managed to get it working by changing the cursorlocation property to adUseServer.

If anyone can give me an idea why this worked it would be appreciated.

Thanks

Sean
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top