KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

Problem with SQL Query

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting
View previous topic :: View next topic  
Author Message
StevenE



Joined: 27 Jul 2005
Posts: 97

PostPosted: Fri Jan 13, 2006 11:13 am    Post subject: Problem with SQL Query Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12795
Location: USA

PostPosted: Fri Jan 13, 2006 12:27 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
StevenE



Joined: 27 Jul 2005
Posts: 97

PostPosted: Fri Jan 13, 2006 3:51 pm    Post subject: Reply with quote

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

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

StevenE
Back to top
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12795
Location: USA

PostPosted: Fri Jan 13, 2006 4:02 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
StevenE



Joined: 27 Jul 2005
Posts: 97

PostPosted: Mon Jan 16, 2006 9:22 am    Post subject: Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12795
Location: USA

PostPosted: Mon Jan 16, 2006 9:51 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
StevenE



Joined: 27 Jul 2005
Posts: 97

PostPosted: Mon Jan 16, 2006 4:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12795
Location: USA

PostPosted: Mon Jan 16, 2006 4:07 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Yoorix



Joined: 14 Dec 2005
Posts: 177

PostPosted: Tue Jan 17, 2006 2:56 am    Post subject: Re: Problem with SQL Query Reply with quote

[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
View user's profile Send private message
StevenE



Joined: 27 Jul 2005
Posts: 97

PostPosted: Tue Jan 17, 2006 8:25 am    Post subject: Re: Problem with SQL Query Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index