473,395 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Parameter Issues

I have an Access Database that is reading data from a SharePoint list, then outputting the data into an excel spreadsheet There are many queries involved, about 40 total.
Here is the format of each query:

Expand|Select|Wrap|Line Numbers
  1.  Set qdf20 = db.QueryDefs("<Query Name Here>")
  2.         qdf20!Param1 = Param
  3.         Set rst20 = qdf20.OpenRecordset()           
  4.         qdf20.Close
  5.         rst20.Close
  6.         Set qdf20 = Nothing
  7.         Set rst20 = Nothing 
This is in a 'For' loop, and the 'Param' changes with each iteration of the loop. The problem: Some queries work, and some do not. The only thing that is changed is the query name, the record set name and the query def name. The errors are totally random. The parameters are in an array, and the for the queries that work, all the parameters are successfully transferred.

Solutions I have tried are using the Parameters Collection Object, and using the SQL commands directly in VBA, but that didn't help. The error I receive is: "Too few parameters, expected 1". I have read the other posts concerning this same error, but they do not solve the problem.

I'm at my wits-end trying to find a solution. Can anyone offer any insight? It would be very helpful and much appreciated.
Aug 25 '20 #1
2 2388
cactusdata
214 Expert 128KB
Try to be more specific - assuming Param is the value of the parameter:

Expand|Select|Wrap|Line Numbers
  1. qdf20!Param1.Value = Param
Aug 26 '20 #2
twinnyfo
3,653 Expert Mod 2GB
Campbell,

In order for us to address any of those issues, we would need to see the QueryDefs you are using for each specific error. That is the only way we can solve those specific errors.

Otherwise, we are simply guessing.

Thanks!
Aug 26 '20 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Phil IU Guy | last post by:
I am having 2 issues, both acting very randomly, and for the most part I dont get this message on most computers, but I have had a couple computers get either issue 1, or issue 2. Issue #1: I...
5
by: DataB | last post by:
Hi everyone, I have this piece of VBA script: ' checking the DOB field to see if we constrain on the date If Len(Me.EmpDOBTxt & "") > 0 Then strWhere = strWhere & " AND . <= #" & Me.DOBTxt &...
6
by: Catherine Jones | last post by:
Hi all, we need urgent help in a matter. We are trying to pass a COM object from the client to server and are facing some problems in the same. We've our client in C# as well as the Server...
16
by: hzmonte | last post by:
Correct me if I am wrong, declaring formal parameters of functions as const, if they should not be/is not changed, has 2 benefits; 1. It tells the program that calls this function that the...
6
by: c676228 | last post by:
Hi everyone, I wrote a store procedure that fetch one row data in the database based on the parameter value I entered. After I created the store procedure, the store procedure code looks like...
5
by: cpnet | last post by:
I'm able to pass string parameters with no problems to a LocalReport being displayed by the ASP.NET ReportViewer control. However, my report also has a DateTime parameter. ...
3
by: Brad Baker | last post by:
I have a formview with a datasource that contains a select and update command. The select statement works fine but the update command doesn't seem to be working. After some troubleshooting I have...
4
by: Rahul B | last post by:
Hi, I was getting the error: sqlcode: -911 sqlstate: 40001 , which is "The maximum number of lock requests has been reached for the database." So i increased the locklist size to 200 from the...
4
by: =?Utf-8?B?QmlsbEF0V29yaw==?= | last post by:
Hi, We recently converted a 1.1 project to 2.0 and this included a webservice which accepted XML for one of the parameters. Since converting to 2.0 I am getting the following message: --- A...
7
by: PhilTheGap | last post by:
Hi, I've tried this: <asp:Button ID="Save" runat="server" Text="OK" OnClick="ServerSave" OnClientClick="SaveParam (<% Util.MaxTags %>)" /> but if fails... Util is a C# class, MaxTags a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.