473,782 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Recordset Error

Hi and TIA! I have a query that uses 2 values from my form as criteria for
2 fields in the query. I can select the options and open the query. I can
base a form on the query and launch it from my criteria form with no
problem. However if I try to open a recordset object against the query from
this same criteria form I receive the (error # 3061 Too few parameters.
expected 2.). I've tried first opening the query from code, which worked
fine, then building my recordset, but received the same error. Any help is
appreciated.

Set db = CurrentDb()
Set rst1 = db.OpenRecordse t("select * From [qryMyQry]")

--
Reggie

"Half this game is 90% mental."

----------
Nov 12 '05 #1
2 4439
On Sun, 28 Sep 2003 00:10:28 -0600 in comp.databases. ms-access,
"Reggie" <newsgroups@no_ spam.comcast.ne t> wrote:
Hi and TIA! I have a query that uses 2 values from my form as criteria for
2 fields in the query. I can select the options and open the query. I can
base a form on the query and launch it from my criteria form with no
problem. However if I try to open a recordset object against the query from
this same criteria form I receive the (error # 3061 Too few parameters.
expected 2.). I've tried first opening the query from code, which worked
fine, then building my recordset, but received the same error. Any help is
appreciated.

Set db = CurrentDb()
Set rst1 = db.OpenRecordse t("select * From [qryMyQry]")


In DAO you have to open the query and set the parameters, e.g.

Set qdf = db.QueryDefs("q ryMyQry")
qdf.parameters( "nameofparamete r1")=valueofpar ameter1
qdf.parameters( "nameofparamete r2")=valueofpar ameter2
set rst1=qdf.OpenRe cordset()
....
--
A)bort, R)etry, I)nfluence with large hammer.
Nov 12 '05 #2
I see said the blind man. Thanks Trevor!

--
Reggie

"Half this game is 90% mental."

----------
"Trevor Best" <bouncer@localh ost> wrote in message
news:i8******** *************** *********@4ax.c om...
On Sun, 28 Sep 2003 00:10:28 -0600 in comp.databases. ms-access,
"Reggie" <newsgroups@no_ spam.comcast.ne t> wrote:
Hi and TIA! I have a query that uses 2 values from my form as criteria for2 fields in the query. I can select the options and open the query. I canbase a form on the query and launch it from my criteria form with no
problem. However if I try to open a recordset object against the query fromthis same criteria form I receive the (error # 3061 Too few parameters.
expected 2.). I've tried first opening the query from code, which worked
fine, then building my recordset, but received the same error. Any help isappreciated.

Set db = CurrentDb()
Set rst1 = db.OpenRecordse t("select * From [qryMyQry]")


In DAO you have to open the query and set the parameters, e.g.

Set qdf = db.QueryDefs("q ryMyQry")
qdf.parameters( "nameofparamete r1")=valueofpar ameter1
qdf.parameters( "nameofparamete r2")=valueofpar ameter2
set rst1=qdf.OpenRe cordset()
...
--
A)bort, R)etry, I)nfluence with large hammer.

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2574
by: David Berry | last post by:
I'm trying to use a recordset inside of a function but I'm getting an "object required 'adoRS" error. At the top of the page I create my recordset, ex: dim strConnection, adoCN, adoRS, strSQL strConnection = <Connection> Set adoCN = server.CreateObject("ADODB.connection") Set adoRS = server.CreateObject("ADODB.recordset") adoCN.Open strConnection
8
2303
by: dmiller23462 | last post by:
My brain is nuked....Can anybody tell me right off the bat what is wrong with this code? Along with any glaring errors, please let me know the syntax to display a message (Response.Write would be fine I think) that will say "I'm sorry but the data you requested cannot be found" or something along those lines.... This code is on an archive page I have on my company's intranet....The end result is to show 3 records at a time pulled from an...
6
1729
by: Alan Silver | last post by:
Hello, I have an ASP that takes a connection string and SQL statement in the querystring and is supposed to return the XML representation of the recordset to the Response stream (don't worry, this is a local page, not one on the Internet). I had it working fine with row-returning SQL, such as SELECT, but was trying to get it to work with non-row-returnign ones as well (such as UPDATE and DELETE). Not only can't I get this bit to work, I...
5
29848
by: Simone | last post by:
Hello I hope you guys can help me. I am very new to ADO... I am creating a ADODB connection in a module and trying to access it from a command button in a form. Function fxEIDAssgn(plngEID As Long) As Boolean Dim rsAssignedUser As ADODB.Recordset Dim strSelectUser As String
4
5718
by: Gerry Abbott | last post by:
Hi all. I wish to call a recordset from a function. Ive tried the following approach, -------------------------------------------------------- Function PassRS() As Recordset Dim db As Database Dim rs As Recordset Dim myQdf As QueryDef
2
7929
by: ano1optimist | last post by:
I have a form with a search button. I'm using command parameters to pass search criteria to a stored procedure. Here is my code: Stored procedure: CREATE PROCEDURE . @strCriteria varchar(200) AS execute (@strCriteria) GO
3
6901
by: Nathan Bloomfield | last post by:
Hi there, I am having difficulty with a piece of code which would work wonders for my application if only the error trapping worked properly. Basically, it works as follows: - adds records from rsSource into rsDest - if it finds a key violation then it deletes the current record from rsDest and adds the new record from rsSource. This works perfectly - but only for the first found duplicate record, it brings up the error
7
8370
by: marmottedodue | last post by:
Hello, I'm trying to debug an access project in which two kind of recordset are used: ADODB.recordset and DAO.recordset. I'm trying to set the whole project on DAO.recordset, but the following function does not work: Public Function GetRecordset(pstrCmdTxt As String, Optional pintCursorType As CursorTypeEnum = adOpenStatic) As Recordset ' was ADODB.recordset
2
4815
by: technocraze | last post by:
Hi guys, I have encountered this error when updating the values to the MS Acess table. Error : Update on linked table failed. ODBC sql server error Timeout expired. MS Acess is my front end and sql server is my backend server. This error occured whenever i step through and when it reaches rs.update it jux hangs down there and thereafter it shwn the aforementioned error. I am using the RecordSet properties to add the values. Can I use...
2
5515
by: wallconor | last post by:
Hi, I am having a problem using Dreamweaver CS3 standard recordset paging behavior. It doesn’t seem to work when I pass parameter values from a FORM on my search page, to the recordset on my results page. - Recordset Paging works if no parameters are used in the recordset sql code (ie. simple sql code): SELECT * FROM db_name WHERE (db_field1 LIKE ‘%text1%’ OR db_field2 LIKE ‘%text2%’)
0
9641
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10146
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10080
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9944
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6735
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5378
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2875
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.