Problem with SQL Query

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
StevenE
Posts: 97
Joined: Wed Jul 27, 2005 2:23 pm

Problem with SQL Query

Post by 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));


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
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

That's answer from ODBC driver. HostMonitor just sends query and shows responce.
What Access manual says about such error?

Regards
Alex
StevenE
Posts: 97
Joined: Wed Jul 27, 2005 2:23 pm

Post by StevenE »

I cannot find any information on the error, other than a MS KB article.

http://support.microsoft.com/default.aspx/kb/171850

StevenE
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

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
StevenE
Posts: 97
Joined: Wed Jul 27, 2005 2:23 pm

Post by StevenE »

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
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

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
StevenE
Posts: 97
Joined: Wed Jul 27, 2005 2:23 pm

Post by StevenE »

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
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

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
Yoorix
Posts: 177
Joined: Wed Dec 14, 2005 8:28 am

Re: Problem with SQL Query

Post by Yoorix »

[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".
StevenE
Posts: 97
Joined: Wed Jul 27, 2005 2:23 pm

Re: Problem with SQL Query

Post by StevenE »

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
Post Reply