Error Trying To Select Record Via Guid Query Prompt Follow

0
Avatar
Legacy Poster

I'm using a custom sql statement with a query prompt. When I try to browse filling the query prompt field with a Guid, I get "OLE DB has encountered error 0x80040E14: Unknown error. OLE DB error message: IDispatch error #3092".

Here's the sql:

SELECT dbo.vwINVENTORY.ASSETID, dbo.vwINVENTORY.NAME, dbo.vwINVENTORYDETAILS.SERIAL_NUMBER, dbo.vwUSERS.FULL_NAME
FROM dbo.vwINVENTORY INNER JOIN
dbo.vwINVENTORYDETAILS ON dbo.vwINVENTORY.ID = dbo.vwINVENTORYDETAILS.INVENTORY_ID INNER JOIN
dbo.vwUSERS ON dbo.vwINVENTORYDETAILS.CREATED_BY_ID = dbo.vwUSERS.ID
WHERE vwINVENTORYDETAILS.ID=?InventoryDetailID
ORDER BY SERIAL_NUMBER

If I hard code the guid into the sql instead of using a query prompt, it works just fine.

Is a guid query prompt not supported?

1 comments

0
Avatar
Legacy Poster
Comment actions Permalink

I got it working. I needed to have apostrophes surrounding the query prompt as below:

SELECT dbo.vwINVENTORY.ASSETID, dbo.vwINVENTORY.NAME, dbo.vwINVENTORYDETAILS.SERIAL_NUMBER, dbo.vwUSERS.FULL_NAME
FROM dbo.vwINVENTORY INNER JOIN
dbo.vwINVENTORYDETAILS ON dbo.vwINVENTORY.ID = dbo.vwINVENTORYDETAILS.INVENTORY_ID INNER JOIN
dbo.vwUSERS ON dbo.vwINVENTORYDETAILS.CREATED_BY_ID = dbo.vwUSERS.ID
WHERE vwINVENTORYDETAILS.ID='?InventoryDetailID'
ORDER BY SERIAL_NUMBER

But also needed to have the Default Reply field be empty. I had a "1" in there.

Please sign in to leave a comment.