I am trying to get primary keys from a table using sp_pkeys in VB. I would like them in a recordset. This is what I am doing:

Set cmdPrimaryKey.ActiveConnection = gcnProj
cmdPrimaryKey.CommandType = adCmdStoredProc
cmdPrimaryKey.CommandTimeout = 0

Set param1 = cmdPrimaryKey.CreateParameter("tmpQuestionnaireDum pReport", adIUnknown, adParamUnknown)

Set rsPrimaryKey = cmdPrimaryKey.Execute

It doesn't like the parameter I am passing to it. Even if I do:

Set param1 = cmdPrimaryKey.CreateParameter("'tmpQuestionnaireDu mpReport'", adIUnknown, adParamUnknown)

it doesn't work

I know that in the SQL Query Analyzer:
sp_pkeys 'tmpQuestionnaireDumpReport' works.

Please help.