Sign Up |  Live StatsLive Stats    Articles 37,472| Comments 178,721| Members 19,496, Newest harshith| Online 442
Home Contact
 (Forgotten?): 
    10 years of Excellence
    For best SPN experience, use Firefox Internet Browser!


                                                                   Your Banner Here!    




Click Here to Register/Sign Up Daily Hukamnama Member Blogs Downloads Website Navigation Help Fonts Tags
Sikh Philosophy Network » Sikh Philosophy Network » Current News » Information Technology » [Microsoft][ODBC Microsoft Access Driver] Syntax Error in ORDER BY clause

[Microsoft][ODBC Microsoft Access Driver] Syntax Error in ORDER BY clause

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 500 USD, Received: 0 USD (0%)
Please Donate...
     
Related Topics...
Thread Thread Starter Forum Replies Last Post
Error: Microsoft Office Access can't find object Noel Information Technology 1 28-Jul-2006 08:33 AM
Controlling session timeout when using Microsoft ODBC for Oracle D SJSFoxPro Information Technology 0 28-Jul-2006 08:21 AM
ODBC Microsoft Access Driver Login Failed Lee Allen Information Technology 0 28-Jul-2006 08:17 AM
Microsoft Access error 3583 Mord Information Technology 0 28-Jul-2006 08:16 AM
Syntax error in FROM clause AppleJack Information Technology 1 16-Nov-2005 14:50 PM


Tags
microsoftodbc, microsoft, access, driver, syntax, error, order, clause
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #1 (permalink)  
Old 11-Nov-2005, 20:09 PM
Marc Everlove's Avatar Marc Everlove
Guest
 
Posts: n/a
   
   
[Microsoft][ODBC Microsoft Access Driver] Syntax Error in ORDER BY clause

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
Here is the statement...

SELECT *, rand() as random_number
FROM image_img
ORDER BY random_number DESC LIMIT 1

I suspect that the rand() is not supported in MS Access. I am not sure what
syntex to put in it's place...

Can anybody tell me what I have done wrong?
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/7173-microsoft-odbc-microsoft-access-driver-syntax.html



*







Do you agree or disagree with the writer above? Why not share your immediate thoughts with us! Login Now! or Sign Up Today! to share your views... Gurfateh!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-Nov-2005, 20:09 PM
Jeff Boyce's Avatar Jeff Boyce
Guest
 
Posts: n/a
   
   
Re: [Microsoft][ODBC Microsoft Access Driver] Syntax Error in ORDER BY clause

Marc

If I were testing this SQL, I would first drop the ORDER BY clause and see
what Access returns for the rest.

What is the purpose of the "LIMIT 1" clause?

Jeff Boyce


"Marc Everlove" wrote in message
news:%23oz7mkl5FHA.2364@TK2MSFTNGP12.phx.gbl...
> Here is the statement...
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7173
>
> SELECT *, rand() as random_number
> FROM image_img
> ORDER BY random_number DESC LIMIT 1
>
> I suspect that the rand() is not supported in MS Access. I am not sure
> what syntex to put in it's place...
>
> Can anybody tell me what I have done wrong?
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7173
>
>



Reply With Quote
  #3 (permalink)  
Old 11-Nov-2005, 20:09 PM
Marc Everlove's Avatar Marc Everlove
Guest
 
Posts: n/a
   
   
Re: [Microsoft][ODBC Microsoft Access Driver] Syntax Error in ORDER BY clause

Wow that was quick!

Ok, I am a network guy, so bear with me.

I will try to drop that statement, and see what happens. I am using an
extension for Dreamweaver... I got the statement from a tutorial. I am
assuming that it is for a MySQL DB as they refer to a php file...

Regarding the limit 1 clause, I have no idea. I am just struggling through
this.

I am ultimately attempting to create an image gallery that allows users to
upload and display images...

Thanks in advance!


"Jeff Boyce" wrote in message
news:%23%230FSsl5FHA.2888@tk2msftngp13.phx.gbl...
> Marc
>
> If I were testing this SQL, I would first drop the ORDER BY clause and see
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7173
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7173
> what Access returns for the rest.
>
> What is the purpose of the "LIMIT 1" clause?
>
> Jeff Boyce
>
>
> "Marc Everlove" wrote in message
> news:%23oz7mkl5FHA.2364@TK2MSFTNGP12.phx.gbl...
>> Here is the statement...
>>
>> SELECT *, rand() as random_number
>> FROM image_img
>> ORDER BY random_number DESC LIMIT 1
>>
>> I suspect that the rand() is not supported in MS Access. I am not sure
>> what syntex to put in it's place...
>>
>> Can anybody tell me what I have done wrong?
>>
>>

>
>



Reply With Quote
  #4 (permalink)  
Old 11-Nov-2005, 20:09 PM
Marc Everlove's Avatar Marc Everlove
Guest
 
Posts: n/a
   
   
Re: [Microsoft][ODBC Microsoft Access Driver] Syntax Error in ORDER BY clause

ok I tried

SELECT *, rand() as random_number
FROM image_img

and I got:

Undefined function 'rand' in expression

Looks like another looooong night...

Thanks!!!

"Marc Everlove" wrote in message
news:OFRhXyl5FHA.1276@TK2MSFTNGP09.phx.gbl...
> Wow that was quick!
>
> Ok, I am a network guy, so bear with me.
>
> I will try to drop that statement, and see what happens. I am using an
> extension for Dreamweaver... I got the statement from a tutorial. I am
> assuming that it is for a MySQL DB as they refer to a php file...
>
> Regarding the limit 1 clause, I have no idea. I am just struggling through
> this.
>
> I am ultimately attempting to create an image gallery that allows users to
> upload and display images...
>
> Thanks in advance!
>
>
> "Jeff Boyce" wrote in message
> news:%23%230FSsl5FHA.2888@tk2msftngp13.phx.gbl...
>> Marc
>>
>> If I were testing this SQL, I would first drop the ORDER BY clause and
>> see what Access returns for the rest.
>>
>> What is the purpose of the "LIMIT 1" clause?
>>
>> Jeff Boyce
>>
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7173
>>
>> "Marc Everlove" wrote in message
>> news:%23oz7mkl5FHA.2364@TK2MSFTNGP12.phx.gbl...
>>> Here is the statement...
>>>
>>> SELECT *, rand() as random_number
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7173
>>> FROM image_img
>>> ORDER BY random_number DESC LIMIT 1
>>>
>>> I suspect that the rand() is not supported in MS Access. I am not sure
>>> what syntex to put in it's place...
>>>
>>> Can anybody tell me what I have done wrong?
>>>
>>>

>>
>>

>
>



Reply With Quote
  #5 (permalink)  
Old 11-Nov-2005, 20:09 PM
Van T. Dinh's Avatar Van T. Dinh
Guest
 
Posts: n/a
   
   
Re: [Microsoft][ODBC Microsoft Access Driver] Syntax Error in ORDER BY clause

The random number function in VBA is Rnd().
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7173

If Rnd() is used in an SQL String in Access, it should be OK. However, you
are only using JET (NOT Access) and Rnd() may NOT work for you.

--
HTH
Van T. Dinh
MVP (Access)



"Marc Everlove" wrote in message
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7173
news:#w3ye6l5FHA.2776@TK2MSFTNGP15.phx.gbl...
> ok I tried
>
> SELECT *, rand() as random_number
> FROM image_img
>
> and I got:
>
> Undefined function 'rand' in expression
>
> Looks like another looooong night...
>
> Thanks!!!
>




Reply With Quote
  #6 (permalink)  
Old 12-Nov-2005, 22:39 PM
Marc Everlove's Avatar Marc Everlove
Guest
 
Posts: n/a
   
   
Re: [Microsoft][ODBC Microsoft Access Driver] Syntax Error in ORDER BY clause

Ok I rewrote the statement so it is now:

SELECT *
FROM image_img
ORDER BY rnd(1(id_img) * 0 + 1)

It doesn't return an error but the image is always the same... It doesn't
randomize!

What's amiss with it???

Thanks in advance!



"Van T. Dinh" wrote in message
news:%23u5Cbto5FHA.744@TK2MSFTNGP10.phx.gbl...
> The random number function in VBA is Rnd().
>
> If Rnd() is used in an SQL String in Access, it should be OK. However,
> you
> are only using JET (NOT Access) and Rnd() may NOT work for you.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7173
>
> --
> HTH
> Van T. Dinh
> MVP (Access)
>
>
>
> "Marc Everlove" wrote in message
> news:#w3ye6l5FHA.2776@TK2MSFTNGP15.phx.gbl...
>> ok I tried
>>
>> SELECT *, rand() as random_number
>> FROM image_img
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7173
>>
>> and I got:
>>
>> Undefined function 'rand' in expression
>>
>> Looks like another looooong night...
>>
>> Thanks!!!
>>

>
>
>



Reply With Quote
  #7 (permalink)  
Old 12-Nov-2005, 22:39 PM
Dirk Goldgar's Avatar Dirk Goldgar
Guest
 
Posts: n/a
   
   
Re: [Microsoft][ODBC Microsoft Access Driver] Syntax Error in ORDER BY clause

"Marc Everlove" wrote in message
news:uSvvTDx5FHA.2196@TK2MSFTNGP10.phx.gbl
> Ok I rewrote the statement so it is now:
>
> SELECT *
> FROM image_img
> ORDER BY rnd(1(id_img) * 0 + 1)
>
> It doesn't return an error but the image is always the same... It
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7173
> doesn't randomize!
>
> What's amiss with it???


See this link:

http://www.mvps.org/access/queries/qry0011.htm
Queries: Create a query that returns Random records

Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7173
--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


Reply With Quote
  #8 (permalink)  
Old 13-Nov-2005, 17:33 PM
Marc Everlove's Avatar Marc Everlove
Guest
 
Posts: n/a
   
   
Re: [Microsoft][ODBC Microsoft Access Driver] Syntax Error in ORDER BY clause

  Donate Today!  
Ok, I did my best to follow the directions but now it returns the error:

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

[Microsoft][ODBC Microsoft Access Driver] Undefined function 'randomizer' in expression.

/uptest/ugh02.asp, line 14

Of course line 14 is where I open the recordset...

I added the module to the database, but frankly, I am a noob at this so I am not certain I did it correctly. I have been attempting to look up information on how to accomplish this all, but have not been very successful. However, the randomizer query you linked to has come up a few times, so it is probably the best option. Now if I could just figure out how to make it work...
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7173

I really appreciate all the assistance!



"Dirk Goldgar" wrote in message news:eTDXXKx5FHA.3592@TK2MSFTNGP12.phx.gbl...
> "Marc Everlove" wrote in message
> news:uSvvTDx5FHA.2196@TK2MSFTNGP10.phx.gbl
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7173
>> Ok I rewrote the statement so it is now:
>>
>> SELECT *
>> FROM image_img
>> ORDER BY rnd(1(id_img) * 0 + 1)
>>
>> It doesn't return an error but the image is always the same... It
>> doesn't randomize!
>>
>> What's amiss with it???

>
> See this link:
>
> http://www.mvps.org/access/queries/qry0011.htm
> Queries: Create a query that returns Random records
>
> --
> Dirk Goldgar, MS Access MVP
> www.datagnostics.com
>
> (please reply to the newsgroup)
>
>

Reply With Quote
  #9 (permalink)  
Old 13-Nov-2005, 17:33 PM
Douglas J. Steele's Avatar Douglas J. Steele
Guest
 
Posts: n/a
   
   
Re: [Microsoft][ODBC Microsoft Access Driver] Syntax Error in ORDER BY clause

How are calling your query? Is it from outside of Access (VB, VB.Net, ASP,
etc.)? If so, I'm afraid you're out of luck: you can only use VBA
user-defined functions from inside Access.

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Marc Everlove" wrote in message
news:eJ1$eN85FHA.1028@TK2MSFTNGP11.phx.gbl...
Ok, I did my best to follow the directions but now it returns the error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC Microsoft Access Driver] Undefined function 'randomizer' in
expression.
/uptest/ugh02.asp, line 14
Of course line 14 is where I open the recordset...
I added the module to the database, but frankly, I am a noob at this so I am
not certain I did it correctly. I have been attempting to look up
information on how to accomplish this all, but have not been very
successful. However, the randomizer query you linked to has come up a few
times, so it is probably the best option. Now if I could just figure out how
to make it work...
I really appreciate all the assistance!



"Dirk Goldgar" wrote in message
news:eTDXXKx5FHA.3592@TK2MSFTNGP12.phx.gbl...
> "Marc Everlove" wrote in message
> news:uSvvTDx5FHA.2196@TK2MSFTNGP10.phx.gbl
>> Ok I rewrote the statement so it is now:
>>
>> SELECT *
>> FROM image_img
>> ORDER BY rnd(1(id_img) * 0 + 1)
>>
>> It doesn't return an error but the image is always the same... It
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7173
>> doesn't randomize!
>>
>> What's amiss with it???

Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=7173
>
> See this link:
>
> http://www.mvps.org/access/queries/qry0011.htm
> Queries: Create a query that returns Random records
>
> --
> Dirk Goldgar, MS Access MVP
> www.datagnostics.com
>
> (please reply to the newsgroup)
>
>


Reply With Quote
   Click Here to Donate Now!

Support Us!
Become a Promoter!
Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(View-All Members who have read this thread : 0
There are no names to display.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Tools Search
Search:

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 On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

» Active Discussions
Do you have to take...
By Bunky
Today 18:32 PM
0 Replies, 10 Views
Amrit sanchar...
By Ishna
Today 18:16 PM
3 Replies, 22 Views
Can Sikhs worship...
Today 17:14 PM
41 Replies, 479 Views
Would an Atheist Pray in...
Today 13:57 PM
63 Replies, 5,337 Views
Nice Punjabi Songs with...
Today 08:50 AM
19 Replies, 537 Views
Sikh Philosophy Network...
Today 04:13 AM
18 Replies, 865 Views
Rozana Reports (ਪੰਜਾਬੀ...
Today 03:39 AM
410 Replies, 9,491 Views
Thought of the Moment!
Today 00:06 AM
116 Replies, 6,148 Views
English Sri Guru Granth Sahib Ji Translations
Yesterday 23:30 PM
6 Replies, 124 Views
Sikh Spokesman (ਪੰਜਾਬੀ...
Yesterday 21:25 PM
256 Replies, 6,096 Views
Difference in Bowing...
By Kamala
Yesterday 15:08 PM
11 Replies, 289 Views
What Really Happened on...
Yesterday 12:46 PM
13 Replies, 270 Views
Free Online Gurbani...
Yesterday 03:56 AM
13 Replies, 4,356 Views
English Sri Guru Granth...
Yesterday 03:51 AM
5 Replies, 191 Views
Edward Snowden: the...
Yesterday 03:34 AM
3 Replies, 206 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.3
All times are GMT +6.5. The time now is 19:02 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 1.23808 seconds with 32 queries