|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
end of Statement error
hi
i keep getting this error message and dont know why Microsoft VBScript compilation (0x800A0401) Expected end of statement /------/------.asp, line 20, column 31 here is the script <!--- should get ---> <!--- current system date and time ---> Today's date and time is <%=Now()%><br> <% 'search the database Set MyConnection=Server.CreateObject ("ADODB.Connection") MyConnection.Open "database" 'MySQLQuery = "Select * from ParentTable WHERE (keyword= '" 'MySQLQuery = MySQLQuery & Request("personID") 'MySQLQuery = MySQLQuery & "')" 'SELECT ParentTable.Name, ParentTable.GroupID, personID.personID 'FROM personID INNER JOIN ParentTable ON personID.ID = ParentTable.personID; MySQLQuery = "SELECT ParentTable.Name, ParentTable.GroupID, personID.personID= " MySQLQuery = MySQLQuery & FROM personID INNER JOIN ParentTable ON personID.ID = ParentTable.personID" Set MyRecordSet=MyConnection.Execute(MySQLQuery) MySQLQuery = MySQLQuery & Request("personID") MySQLQuery = MySQLQuery & "')" Set MyRecordSet=MyConnection.Execute(MySQLQuery) heres is where the error occurs MySQLQuery = "SELECT ParentTable.Name, ParentTable.GroupID, personID.personID= " MySQLQuery = MySQLQuery & FROM personID INNER JOIN ParentTable ON personID.ID = ParentTable.personID" Set MyRecordSet=MyConnection.Execute(MySQLQuery) MySQLQuery = MySQLQuery & Request("personID") MySQLQuery = MySQLQuery & "')" Set MyRecordSet=MyConnection.Execute(MySQLQuery) i hope someone can help thanks |
|
#2
|
|||
|
|||
|
personID.personID= "
this line isn't complete, to continue a line to the next line do this Code:
strSQL = "select * " & _
"from table"
not to mention Code:
MySQLQuery = MySQLQuery & FROM personID INNER JOIN ParentTable ON personID.ID = ParentTable.personID" you didn't start the FROM with " to start the string i think that's it, it may just be formatting issues with your post, use CODE] and [/CODE tags around code postings.. Last edited by unatratnag : August 16th, 2003 at 08:41 AM. |
|
#3
|
|||
|
|||
|
Quote:
hi it didnt work if you want to help i can send the script again thanks anyway |
|
#4
|
|||
|
|||
|
well if you wanted more help on getting it to work... it'd help to post the script and error message so yet.... It didn't work doesn't exactly help me in debugging your code though...
copying and pasting your code to my notepad showed those as being the errors, so that should have fixed that error..... On another note: SELECT ParentTable.Name, ParentTable.GroupID, personID.personID= FROM personID INNER JOIN ParentTable ON personID.ID = ParentTable.personID also, this select statement won't work due to the = sign after personID, at least to my knowledge of sql, unless you're a sql master and know something I don't.... |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > end of Statement error |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|