467,088 Members | 1,288 Online
Bytes | Developer Community
Ask Question

Home New Posts Topics Members FAQ

Post your question to a community of 467,088 developers. It's quick & easy.

Output parameter in "Find Duplicate " query of access

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.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
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
  • viewed: 1142
Share:

Post your reply

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

Similar topics

2 posts views Thread by Matt W via AccessMonster.com | last post: by
2 posts views Thread by Julie Wardlow | last post: by
1 post views Thread by carrionk@yahoo.com | last post: by
2 posts views Thread by francophone77 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.