 |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning ASP 3.0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|
|

June 17th, 2004, 11:02 PM
|
|
Authorized User
|
|
Join Date: Mar 2004
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
just a question
i keep getting an error with this line of code:
tdcdelete.Open "Select * from news_messages where number=" & Request.Form("dates"), objconn,1,2
the error is:
Microsoft JET Database Engine error '80040e14'
Syntax error (missing operator) in query expression 'number='.
If you know what is wrong if you could email me that would be awsome at [email protected] or just respond to this post
THanks alot
|
|

June 17th, 2004, 11:33 PM
|
|
Friend of Wrox
|
|
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
|
|
I think you are not getting the values in Request.Form("dates").
what Request.Form("dates") returns number or date?
Om Prakash
|
|

June 18th, 2004, 12:10 AM
|
|
Authorized User
|
|
Join Date: Mar 2004
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
<%
tdcVIEWdates=""
Do While NOT tdcGETnews.EOF
tdcVIEWdates=tdcVIEWdates & "<option value=" & tdcGETnews("number") & ">" & tdcGETnews("tdcopendate") & " <---> " & tdcGETnews("tdcclosedate") & "</option>"
tdcGETnews.MoveNext
Loop
Set tdcGETnews = nothing
%>
<b> </b> <br>
<select size="8" name="dates" onDblClick="submit()"><%=tdcVIEWdates %></select> <br>
<input type="submit" value="View" name="View"></p>
<%If NOT isEmpty(Request.Form("dates")) Then
Set tdcGETnews = Server.CreateObject("ADODB.RecordSet")
tdcGETnews.Open "Select * from news_messages Where number=" + Request.Form("dates"),ObjConn,1,2
If Not tdcGETnews.EOF Then
%>
|
|

June 18th, 2004, 12:45 AM
|
|
Friend of Wrox
|
|
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
|
|
modify
tdcGETnews.Open "Select * from news_messages Where number=" + Request.Form("dates"),ObjConn,1,2
to
tdcGETnews.Open "Select * from news_messages Where number=" & Request.Form("dates"),ObjConn,1,2
Om Prakash
|
|

June 18th, 2004, 01:45 AM
|
|
Authorized User
|
|
Join Date: Mar 2004
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
still did not work
|
|

June 18th, 2004, 01:50 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
I think number is a reserved word (the datatype for columns holding a number).
Change it to something like MyNumber, or enclose it in brackets:
Select * from news_messages where [number]
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: And So Is Love by Kate Bush (Track 2 from the album: The Red Shoes) What's This?
|
|

June 18th, 2004, 02:05 AM
|
|
Authorized User
|
|
Join Date: Mar 2004
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
still does not work :(
I have been working on this error for like 2 hours now
|
|

June 18th, 2004, 02:10 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
I think you're still passing an invalid SQL statement. Make the following change to your code, and then post the outcome of the Response.Write statement to this list:
Code:
Dim SQL
SQL = "Select * from news_messages Where [number] = " & Request.Form("dates")
Response.Write("SQL is " & SQL)
Response.End
tdcGETnews.Open SQL,ObjConn,1,2
I am beginning to suspect that Request.Form("dates") does not have a value.....
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Rocket's Tail by Kate Bush (Track 9 from the album: The Sensual World) What's This?
|
|

June 18th, 2004, 02:20 AM
|
|
Authorized User
|
|
Join Date: Mar 2004
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
first i want to let you know that that instead of 'number' now i am using tdcnumber and i did change that before i entered this script into my page.
This is what i get "SQL is Select * from news_messages Where tdcnumber ="
|
|

June 18th, 2004, 02:35 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Right, just what I thought. You're not getting a valid value from Request.Form("dates")
Where does Request.Form("dates") come from? From another page? Are you sure the field is called dates and contains a valid value?
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: miDijunkies by Atari Teenage Riot (Track 6 from the album: Delete Yourself) What's This?
|
Similar Threads
|
| Thread |
Thread Starter |
Forum |
Replies |
Last Post |
| question |
maheshraju |
ASP.NET 2.0 Basics |
3 |
March 13th, 2008 08:54 AM |
| Question |
Ashwini |
Classic ASP Databases |
3 |
January 10th, 2006 07:20 AM |
| Question? |
Calibus |
Classic ASP Databases |
8 |
August 6th, 2004 08:25 AM |
| a question |
gorji |
C++ Programming |
2 |
August 11th, 2003 07:41 AM |
|
 |