Problem SQL ADO

len lsumnler at gmail.com
Tue Sep 27 19:50:17 CEST 2005


Using Python on WinXP going against MS SQL 2000 server.  Connection is
fine and I have executed several queries successfully.  The following
SQL statement however gives me an error and I have tried it several
different ways:

"SELECT
VA_MK_YEAR,VA_MK_DESCRIP,VO_VIN_NO,VO_MODEL,VO_BODY,VO_DESCRIPTION" + \
    "FROM D014800 LEFT OUTER JOIN D014900 ON (VA_MK_NUMBER_VER =
VO_MAKE_NO) AND (VA_MK_YEAR = VO_YEAR)" + \
    "WHERE (((VA_MK_YEAR)=?) AND ((VA_MK_DESCRIP)=?) AND
((VO_MODEL)=?))"

I have tried it with a "INNER JOIN", "JOIN", "LEFT JOIN" etc and get
the following error each time with a syntax error just after the word
INNER, JOIN, or
LEFT sample message below:

com_error: (-2147352567, 'Exception occurred.', (0, 'Microsoft OLE DB
Provider for SQL Server', "Incorrect syntax near the keyword 'LEFT'.",
None, 0, -2147217900), None)

OR

com_error: (-2147352567, 'Exception occurred.', (0, 'Microsoft OLE DB
Provider for SQL Server', "Incorrect syntax near the keyword 'INNER'.",
None, 0, -2147217900), None)

any help appreciated




More information about the Python-list mailing list