Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 17th, 2004, 11:02 PM
Authorized User
 
Join Date: Mar 2004
Location: , , .
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to gmoney060 Send a message via MSN to gmoney060
Default 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 scoremaster25@msn.com or just respond to this post

THanks alot

  #2 (permalink)  
Old June 17th, 2004, 11:33 PM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

I think you are not getting the values in Request.Form("dates").

what Request.Form("dates") returns number or date?



Om Prakash
  #3 (permalink)  
Old June 18th, 2004, 12:10 AM
Authorized User
 
Join Date: Mar 2004
Location: , , .
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to gmoney060 Send a message via MSN to gmoney060
Default

<%
        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
       %>

  #4 (permalink)  
Old June 18th, 2004, 12:45 AM
Friend of Wrox
Points: 2,473, Level: 20
Points: 2,473, Level: 20 Points: 2,473, Level: 20 Points: 2,473, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: India
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

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
  #5 (permalink)  
Old June 18th, 2004, 01:45 AM
Authorized User
 
Join Date: Mar 2004
Location: , , .
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to gmoney060 Send a message via MSN to gmoney060
Default

still did not work

  #6 (permalink)  
Old June 18th, 2004, 01:50 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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?
  #7 (permalink)  
Old June 18th, 2004, 02:05 AM
Authorized User
 
Join Date: Mar 2004
Location: , , .
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to gmoney060 Send a message via MSN to gmoney060
Default

still does not work :(

I have been working on this error for like 2 hours now

  #8 (permalink)  
Old June 18th, 2004, 02:10 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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?
  #9 (permalink)  
Old June 18th, 2004, 02:20 AM
Authorized User
 
Join Date: Mar 2004
Location: , , .
Posts: 84
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to gmoney060 Send a message via MSN to gmoney060
Default

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 ="

  #10 (permalink)  
Old June 18th, 2004, 02:35 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

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?
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 05:20 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.