But when I try to go to that page I get the following message:
Microsoft OLE DB Provider for SQL Server error '80040e14'
Incorrect syntax near '='.
When I remove the WHERE clause from SQL 2, it seems to work except the only one name appears in all the rows, but when I click on the hyperlink on the ID it shows the correct information for that person.
I think the problem is Active. If that's a Y/N value in SQL Server it's either 0 or 1, not -1, and it shouldn't be in quotes.
SQL = "SELECT * FROM TeamT Where Sport='Wrestling' AND Active=1"
One of the hardest things about switching from Access to SQL Server is remember the different syntax.
Diane StankevitzOP
@Reply 4 years ago
Changing the Y/N values to either 0 or 1, with or without quotes was not the issue. I even removed that WHERE clause altogether, and it wasn't the problem. Changing the AthleteID to 1 only should the first athlete in the database.
Of course it did, because that's what you're asking it to do,
Where is AthleteID coming from? A Query string?
Kevin Robertson
@Reply 4 years ago
Where is AthleteID from? Is it from the first Recordset?
If so try this.
SQL2 = "SELECT * FROM AthleteT WHERE AthleteID=" & RS("AthleteID")
Diane StankevitzOP
@Reply 4 years ago
Hi Kevin, when I added & RS("AthleteID") it gave me one name, however, it was at least the first person on the list I needed. It is the information from another table.
Alex, the AthleteID coming from a second Query string.
All this was working fine when I was using an uploaded database, but I started having problems when I switch to using SQL on the server.
while not rs2.eof
' do stuff here
rs.movenext
wend
Diane StankevitzOP
@Reply 4 years ago
I will try this. Thank you!!!!!
Diane StankevitzOP
@Reply 4 years ago
That doesn't seem to be working either. :-(
Diane StankevitzOP
@Reply 4 years ago
Before when I was just using the Database, it worked just fine. Now that I am using the SQL server, that is when the issues started. I used to just use a query, now I must do things from the table.
Adam Schwanz
@Reply 4 years ago
Is there only one record in AthleteT for each AthleteID?
What does not working mean? Any errors or wrong/missing information displayed?
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Active Server Pages Forum.