|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
I am a newbe to ASP and ADO. I am having a problem with an inner join SQL select statement. This is the eror: Error Type: Microsoft VBScript compilation (0x800A0409) Unterminated string constant /includes/navigation6.asp, line 10, column 58 strSQL = "SELECT dUserName, dAttributeType, dAttributeName Here is the entire SQL statement strSQL = "SELECT dUserName, dAttributeType, dAttributeName FROM UserSecurityAttributes INNER JOIN Users ON Users.dName = UserSecurityAttributes.dUserName WHERE Users.dName = UserSecurityAttributes.dUserName AND Users.dEmail =" & "'" & currentPassword & "'" Can anyone help me with this? It's driving me crazy. |
|
#2
|
|||
|
|||
|
VBScript in asp code is sensitive to line breaks unlike some other programming languages. I usually concatenate my string on multiple lines, or there is a line continuation &_ you can use
Code:
strSQL = "SELECT dUserName, dAttributeType, dAttributeName" strSQL = strSQL & " FROM UserSecurityAttributes INNER JOIN" strSQL = strSQL & " Users ON Users.dName = UserSecurityAttributes.dUserName" strSQL = strSQL & " WHERE Users.dName = UserSecurityAttributes.dUserName AND" strSQL = strSQL & " Users.dEmail =" & "'" & currentPassword & "'"
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
|
#3
|
||||
|
||||
|
try this
Code:
strSql = "SELECT A.dUsername, A.dAttribute, A.dAttributeName FROM UserSecurityAttributes As A INNER JOIN [Users] As B On (A.dUserName = B.dName) WHERE A.dEmail = '" & currentPassword & "'" Foreign keys should have the same name as the Primary key it is referencing (A.dUsername = B.dUsername), it makes it easier to see and understand that a relationship exists between the two tables. |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > Asp/ado |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|