View previous topic :: View next topic |
Author |
Message |
StevenE
Joined: 27 Jul 2005 Posts: 97
|
Posted: Fri Jan 13, 2006 11:13 am Post subject: Problem with SQL Query |
|
|
I am having a problem with 1 SQL Query Command.
SELECT Count(PendingTransmission.Status) AS CountOfStatus
FROM PendingTransmission
WHERE (((PendingTransmission.Name)="RU") AND ((PendingTransmission.Status)=1));
It works fine in MSAccess but when I attempt to run it in HM I get a message stating.
Error 4294967295: [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1
I cannot seem to get it to work.
Thanks
StevenE |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Fri Jan 13, 2006 12:27 pm Post subject: |
|
|
That's answer from ODBC driver. HostMonitor just sends query and shows responce.
What Access manual says about such error?
Regards
Alex |
|
Back to top |
|
|
StevenE
Joined: 27 Jul 2005 Posts: 97
|
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Fri Jan 13, 2006 4:02 pm Post subject: |
|
|
Quote: | This is a limitation of the Microsoft Access ODBC driver. Prompting for query parameters is a functionality of the Microsoft Access user interface. However, the Microsoft Access ODBC driver doesn't have this capability; therefore, it generates an error message. |
I agree - your problem relates to limitation of the Microsoft Access ODBC driver. But it does not look like "Prompting for query parameters".
May be driver doesn't like table specificator "PendingTransmission."? Have you tried query SELECT Count(Status) AS CountOfStatus
FROM PendingTransmission WHERE (((Name)="RU") AND ((Status)=1)); or even more simple SELECT Count(Status)
FROM PendingTransmission WHERE (((Name)="RU") AND ((Status)=1))
I think result must be the same, so why use unnecessary statements?
Regards
Alex |
|
Back to top |
|
|
StevenE
Joined: 27 Jul 2005 Posts: 97
|
Posted: Mon Jan 16, 2006 9:22 am Post subject: |
|
|
I don't know much about sql statements so I was using a sql query builder. And that is what it gave me.
As far as using the simpler ones, they both still give me the same error.
So far no luck.
StevenE |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Mon Jan 16, 2006 9:51 am Post subject: |
|
|
So, probably its good time to read manual that comes with ODBC driver, what statements is supported, what limitations it has?
And lets try some pretty simple query to check driver works or doesn't, something like "Select * from PendingTransmission"
Regards
Alex |
|
Back to top |
|
|
StevenE
Joined: 27 Jul 2005 Posts: 97
|
Posted: Mon Jan 16, 2006 4:03 pm Post subject: |
|
|
Well,
I am using the default windows xp MS access driver for odbc. And I couldn't find any info.
All the SQL statements work fine from inside access, just not through the ODBC with Host Monitor.
At this point, I am past my expertise and seem unable to find any info to proceed further.
I might try creating a query in the access database, and query that with the sql commands.
StevenE |
|
Back to top |
|
|
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Mon Jan 16, 2006 4:07 pm Post subject: |
|
|
So, "Select * from PendingTransmission" doesn't work? It shows the same error? May be you should reinstall ODBC driver or install newer version...
Regards
Alex |
|
Back to top |
|
|
Yoorix
Joined: 14 Dec 2005 Posts: 177
|
Posted: Tue Jan 17, 2006 2:56 am Post subject: Re: Problem with SQL Query |
|
|
[quote="StevenE"]I am having a problem with 1 SQL Query Command.
SELECT Count(PendingTransmission.Status) AS CountOfStatus
FROM PendingTransmission
WHERE (((PendingTransmission.Name)="RU") AND ((PendingTransmission.Status)=1));
[/quote]
I think, the problem is in quotes in WHERE statement. Try to use 'RU' instead of "RU". |
|
Back to top |
|
|
StevenE
Joined: 27 Jul 2005 Posts: 97
|
Posted: Tue Jan 17, 2006 8:25 am Post subject: Re: Problem with SQL Query |
|
|
Yoorix wrote: |
I think, the problem is in quotes in WHERE statement. Try to use 'RU' instead of "RU". |
You would be correct, the query now works without an error.
Thanks Everyone for all the help.
StevenE |
|
Back to top |
|
|
|