OpenRecordSet funtion--need help please

Oct 17, 2006 4 Replies

I have a COM Add-in. And I was trying to use SessonClass.OpenRecordSet to save data to database.



I wrote the following code:



Dim rs As New ADODB.Recordset ... rs = MySession.OpenRecordSet("sprc_SetService(50,'ttt')", True), ... but it comes with "Incorrect syntax near 50". Any one knows why?



If I exec sprc_SetService(50,'ttt') direcly in SQL Query, it works totally fine.



Thanks Leanne



it's a stored procedure.. with OpenRecordset you exec TSQL statemenent..

try with 'exec sprc_SetService(50,'ttt')

cod

Thanks cod. it works. but I need to use "exec sprc_setService 50,'ttt' "instead.

stored procedure.. with OpenRecordset you exec TSQL statemenent..

Or you need an ADODB.Command to invoke with 'adCmdProc' statement and Parameters collection..

cod

Can you show the full exampe please? I tried, but did something wrong

Ene

"Leanne" wrote:

stored procedure.. with OpenRecordset you exec TSQL statemenent..

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required