Parameter query returns empty recordset

G

Guest

Hi

I have the following

strCompany = "*" & Me.CompanyName & "*"
Set cmdCompany = New ADODB.Command
With cmdCompany
.ActiveConnection = adoConnection
.CommandText = "qryCompany"
.CommandType = adCmdStoredProc
Set prmCompany = cmdCompany.CreateParameter("CompanyName", adChar,
adParamInput, 50)
.Parameters.Append prmCompany
prmCompany.Value = strCompany
End With

Set rsCompany = cmdCompany.Execute

When I run this I end up with an emty recordset. If I run the query
separately manually adding the criteria it reutuns records.

What am I missing?

Regards
Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top