By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,813 Members | 1,253 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,813 IT Pros & Developers. It's quick & easy.

Output parameter in "Find Duplicate " query of access

P: 19

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.CommandText = sQueryName
adocmd.CommandType = adCmdStoredProc
adocmd.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\My Documents\Access\Data\ARG_Project2_Access\Warranty .mdb"
' "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\My Documents\Access\Data\ARG_Project2_Access\Warranty DEVSQL.mdb;Persist Security Info=False"

'Create 2 output parameters
Set objPara = adocmd.CreateParameter("[Type]", adVarChar, adParamReturnValue, 50)
Set objpara2 = adocmd.CreateParameter("[Unit Ser No]", adVarChar, adParamReturnValue, 255)

'Append the output parameters to command object
adocmd.Parameters.Append objPara
adocmd.Parameters.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.Item("Type").Value
objpara2(liArray) = rsAdo.Fields.Item("Unit Ser No").Value
liArray = liArray + 1

'Close the recordset

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
Share this question for a faster answer!
Share on Google+

Post your reply

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