473,785 Members | 3,142 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Output parameter in "Find Duplicate " query of access

19 New Member
Hi,

I generate a "Find Duplicate" query for one table that will return some records
I want to capture those records in my VB code.....

This is my code...pls guide me how to proceed....
*************** *************** *************** *************** *************** ************

adocmd.CommandT ext = sQueryName
adocmd.CommandT ype = adCmdStoredProc
adocmd.ActiveCo nnection = "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=C:\My Documents\Acces s\Data\ARG_Proj ect2_Access\War ranty.mdb"
' "Provider=Micro soft.Jet.OLEDB. 4.0;Data Source=C:\My Documents\Acces s\Data\ARG_Proj ect2_Access\War rantyDEVSQL.mdb ;Persist Security Info=False"


'************** ****
'Create 2 output parameters
Set objPara = adocmd.CreatePa rameter("[Type]", adVarChar, adParamReturnVa lue, 50)
Set objpara2 = adocmd.CreatePa rameter("[Unit Ser No]", adVarChar, adParamReturnVa lue, 255)

'Append the output parameters to command object
adocmd.Paramete rs.Append objPara
adocmd.Paramete rs.Append objpara2

'Store the result in a recordset
Set rsAdo = adocmd.Execute


'Open the recordset

liArray = 1
Do While Not rsAdo.EOF
objPara(liArray ) = rsAdo.Fields.It em("Type").Valu e
objpara2(liArra y) = rsAdo.Fields.It em("Unit Ser No").Value
liArray = liArray + 1
rsAdo.MoveNext
Loop

'Close the recordset
rsAdo.Close
*************** **********

I get this error when i run

"-2147217887 : Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done."
Aug 9 '07 #1
0 1382

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

Similar topics

1
1748
by: Jim | last post by:
MS-Access 2002 I have a query (Q2) based on a parameter query (Q1) and need to set the parameters within a VBA module. I am using ADO, and opening the query (Q2) as a fordwardonly recordset. Since Q1 isn't explictly opened in the VBA code, I'm not sure how to set the parameters. I do not want to run Q1 to load a table and then have Q2 based on the table
1
3803
by: Cory | last post by:
When I run the subroutine testEmailContacts the msgbox says that there is only 1 record. The sql for qyEmailContactsQyCard is below. There is over 3000 records in the table "tbl:Contact". What am i doing wrong? Thanks in advance. PARAMETERS cardYesNo Bit, ParSearchCard Bit; SELECT .ContactID FROM WHERE (((.Card)=)) OR ((()=No));
2
550
by: Matt W via AccessMonster.com | last post by:
I based my parameter query off the following posting, but can't seem to work out a little kink. I cannot bring up a report without first typing in the month and year three times. The first time for my Form , the second for the parameter form, and the third which I can't figure out where on earth that one came from. How do I clean this up so I can type in the criteria just once into the form I created? I tried putting !! in the criteria...
2
6517
by: Julie Wardlow | last post by:
Help! I am calculating a future date using the DateAdd function in a query (the calculation also involves an IIf statement), and have managed to get this formula to produce the required result. I then want to search through the records and select those with dates (as caluclated above) within a user defined range, and so I am using a parameter query. However, this query returns dates outside of the range and appears to have particular...
1
2579
by: carrionk | last post by:
Hi, I have created a Subform which SourceObject is a parameter query. This is the Query: Qry Name:80IsscomProduct SELECT * FROM Isscomp28 WHERE Like ;
2
5599
by: francophone77 | last post by:
Does anyone know how to setup a parameter query, which allows the user to choose from a combo box? TIA
1
1481
by: Bill | last post by:
Hi, Our database is Access (i know, i would be better to use Mysql, but at the present time, it's access ...) and i created a parameter query (like a stored procedure in Mysql) for identification with name 'proctest'. The criterium in the query is . PHP must execute the query with the value of variable 'name'. I know how to use PHP with access using dynamic sql, but i don't know how to do with a query. Here is a attempt, but doesn't...
3
3409
by: Smartin | last post by:
I have an Oracle 7x table linked to an Access 97 database. I am trying to write a parameter query but can't seem to get it to work. When I explicitly specify the parameter in the query it works fine. Something like this: > SELECT * > FROM MYTABLE > WHERE ACC_NUM = 'XYZ123' ;
4
2917
by: GladGad | last post by:
I am not a real well versed query writer and therefore am having some problems figuring out how to write a parameter query where I want to input a partial name. I have tried a few different things, but either get no results or all of the records in BANKS are returned. I am using Access 2000 on XP. I am using three tables for this query: BANKS BankID (pk) BankName Other fields that are not pertinent to this query VENDORS ...
7
7728
by: limperger | last post by:
Hello everyone! Just in case anyone has any wonder about this... I have a parameter query that searchs for records that have the particular word provided by the user in a memo field (using the criteria Like "*" & & "*"). I want those results displayed in a form. Additionally, a list box is mandatory, to skip from one record to another one. Unfortunately, when using the list box wizard in this particular case, Access usually encounters a...
0
9645
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
10327
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
10151
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
10092
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
9950
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
5381
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?
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3647
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.