Click here to Skip to main content
15,889,877 members
Please Sign up or sign in to vote.
4.00/5 (2 votes)
Hello,

I have a VB6 application that works fine on most Windows 7 machines (even with UAC turned on), but for some of them if the program is not set to 'Run as administrator' upon startup it will return the error message 'No value given for one or more required parameters' when it tries to query the database.

I know the error message usually means that the table name(s) and/or parameter(s) are spelled incorrectly. But that is not the case here since the same application doing the same proceedures/query calls has no issues on Win XP and some Win 7 machines.

The database is MS Access 2003 format. The database is located in the Program Files directory along with the application exe and dlls.

If this was a consistant error then I could easily debug it and move on, but since all my testing machines do not generate this error, I am at a loss.

Any ideas as to why this occurs and how to fix it?

Thanks,
Chris
Posted
Comments
Kreagan Naicker 15-Feb-12 14:04pm    
Hi.

Quick question, are all the machines the exact same operating system version?
Also are they all 32bit or 64bit?

If they vary then the location of your database could be an issue.

Have you confirmed the path to the Access Database?

Are you hard coding the path to the database or rather using environment variables to check for the location or a setting within the configuration file?
buzzluck68 15-Feb-12 14:42pm    
All the machines are Windows 7 64-bit. The users all have administrative rights and UAC is turned on.

The database location is located using the App.Path function in VB6 since the database resides in the same location as the application. The connection to the database is opened just fine, it is just when it is retrieving records from the database using a Select query that it gets this error.

And like I stated before, this is not a consistant error on all machines, just some of them. I will try to get my hands on one that is having this problem so I can test some possible solutions. The first one that might work is to remove the database file from the Program Files directory into the Common App Data directory, but without testing I would have no way of knowing for certain if this would work.

Thanks,
Chris
Sergey Alexandrovich Kryukov 15-Feb-12 21:01pm    
How about a code sample manifesting the problem?
--SA

1 solution

Dear Friend,

I think that the problem is with the parameters. For one of the parameter the value is null or blank or the column names are not matching. Please follow the links for more details:-

http://blogs.msdn.com/b/spike/archive/2010/03/04/no-value-given-for-one-or-more-required-parameters-incorrect-syntax-near-the-keyword-default.aspx[^]

http://www.daniweb.com/web-development/aspnet/threads/275039[^]

http://vbadud.blogspot.in/2009/03/no-value-given-for-one-or-more-required.html[^]

Don&'t forget to mark this as your answer if it helps you out.

Thanks
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900