General SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesGeneral SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old February 14th, 2004, 03:13 PM
rockable rockable is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 2 rockable User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 36 sec
Reputation Power: 0
what am I doing wrong?!

Im trying to limit my results to 4 and have a offset of 4 (which will change ie 8 on the next page....

my code is:

Set MyConn=Server.CreateObject("ADODB.Connection")
MyConn.Open "products_pbc"
Set Rs=MyConn.Execute("SELECT * From [products] Where Category='paperback'" ) LIMIT 4,4
WHILE NOT Rs.EOF

but I get the error:

Microsoft VBScript compilation error '800a0401'

Expected end of statement

paperbacks3.asp, line 59

Set Rs=MyConn.Execute("SELECT * From [products] Where Category='paperback'" ) LIMIT 4,4

and I cant find the problem at all!

Please help!

Dave

Reply With Quote
  #2  
Old February 14th, 2004, 04:38 PM
rockable rockable is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2004
Posts: 2 rockable User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 36 sec
Reputation Power: 0
Ive changed it to

Set Rs=MyConn.Execute("SELECT * From [products] Where Category='paperback'LIMIT 4,4" )

to fix this problem, but now i get the error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'

[Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'Category='paperback' LIMIT 4,4'.

paperbacks3.asp, line 59

any ideas?

Cheers! Dave

Reply With Quote
  #3  
Old February 14th, 2004, 06:24 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
You posted this question in mysql/postgres thread, yet the error message you are getting states you are using Access. Which is it? Access does not have a LIMIT statement. Instead google for the TOP statement, which works slightly differently.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesGeneral SQL Development > what am I doing wrong?!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway