|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Query String too long (newbie)
I'm using SQL and ASP to query an access database. My SQL string is really long and I'm getting an "Expected end of statement" error due to the fact that my query string is more than one line long. The SQL string (which works fine in Access) is as follows:<br><br>"SELECT Projects.Title, Projects.Directory, Projects.DateRequested, Projects.DateNeeded, Projects.DateCompleted, Projects.Description, Projects.Notes, [Staff].[FirstName] & " " & [Staff].[LastName] AS StaffName, [Contacts].[FirstName] & " " & [Contacts].[LastName] AS ConName FROM Contacts INNER JOIN (Staff INNER JOIN Projects ON Staff.StaffID = Projects.StaffKey) ON Contacts.ContactID = Projects.ContactKey"<br><br>Many thanks in advance for your help! <br> <img src="/forum/emoticons/burger.gif" alt="burger">
|
|
#2
|
|||
|
|||
|
If you are putting it on more than one line then you need to do it like this....<br><div class="msgQuoteWrap"><div class="msgCode"><br>Dim mySQL <br>mySQL = "SELECT Projects.Title, Projects.Directory, Projects.DateRequested," & _<br>" Projects.DateNeeded, Projects.DateCompleted, Projects.Description, Projects.Notes," & _<br>" [Staff].[FirstName] & " " & [Staff].[LastName] AS StaffName, [Contacts].[FirstName]" & _<br>" " & [Contacts].[LastName] AS ConName FROM Contacts INNER JOIN (Staff INNER JOIN" & _<br>" Projects ON Staff.StaffID = Projects.StaffKey) ON Contacts.ContactID = Projects.ContactKey"<br></div></div><p> </p><p><hr size="1" width="50%" align="left" />dotNetBB Forum Developer<br><b><i>Building A Better Community, One Post At A Time</i></b><br><a href="http://www.dotnetbb.com" target="_blank">www.dotnetbb.com</a></p>
|
![]() |
| Viewing: ASP Free Forums > Database > SQL Development > Query String too long (newbie) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|