Wednesday, March 7, 2012

Error with Select Statement using the SQLDataAdapter Wizard

Error with Select Statement using the SQLDataAdapter Wizard
------------------------

I am needing to setup the data adapter for my SQL database for use with a web page that submits employment applications. When using the wizard I get this error: Incorrect syntax near the keyword 'FROM'. Beings that the code is generated by VB I am confused what would be incorrect. If anyone can see the problem please let me know. THANKS!

Here is the code that is giving me the error:

SELECT
FROM
[Personal Info] INNER
JOIN
Education ON
[Personal Info].[Applicants SSN] = Education.[Applicants SSN] INNER JOIN Legal ON [Personal Info].[Applicants SSN] = Legal.[Applicants SSN] INNER JOIN [Military Service] ON [Personal Info].[Applicants SSN] = [Military Service].[Applicants SSN] INNER JOIN [Employment History] ON [Personal Info].[Applicants SSN] = [Employment History].[Applicants SSN] INNER JOIN [References] ON [Personal Info].[Applicants SSN] = [References].[Applicants SSN] INNER JOIN [Farm Preference] ON [Personal Info].[Applicants SSN] = [Farm Preference].[Applicants SSN]

Quote:

Originally Posted by sds50

Error with Select Statement using the SQLDataAdapter Wizard
------------------------

I am needing to setup the data adapter for my SQL database for use with a web page that submits employment applications. When using the wizard I get this error: Incorrect syntax near the keyword 'FROM'. Beings that the code is generated by VB I am confused what would be incorrect. If anyone can see the problem please let me know. THANKS!

Here is the code that is giving me the error:

SELECT
FROM
[Personal Info] INNER
JOIN
Education ON
[Personal Info].[Applicants SSN] = Education.[Applicants SSN] INNER JOIN Legal ON [Personal Info].[Applicants SSN] = Legal.[Applicants SSN] INNER JOIN [Military Service] ON [Personal Info].[Applicants SSN] = [Military Service].[Applicants SSN] INNER JOIN [Employment History] ON [Personal Info].[Applicants SSN] = [Employment History].[Applicants SSN] INNER JOIN [References] ON [Personal Info].[Applicants SSN] = [References].[Applicants SSN] INNER JOIN [Farm Preference] ON [Personal Info].[Applicants SSN] = [Farm Preference].[Applicants SSN]


You haven't selected anything. You should have:

SELECT field1,field2 ... etc
FROM ...

No comments:

Post a Comment