OpenRecordSet funtion--need help please

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

Reply to
Leanne
Loading thread data ...

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

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

cod

Reply to
cod

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

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

Reply to
Leanne

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

cod

Reply to
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..

Reply to
Ene

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.