Hi ZhenYuan,
I use VBScript instead of Visual Basic but perhaps this can help you because of the similarities. This is what works for me to run a stored procedure from Infopath 2007 in SQL Server 2008:
' Run the stored procedure [UpdateModifiedDay] in the DB
dim cn
set cn = XDocument.QueryAdapter
dim originalCommand
originalCommand = cn.Command ' Save current DB access command
cn.Command = "EXECUTE UpdateModifiedDay"
cn.Query
cn.Command = originalCommand ' Restore previous DB access command
set cn = nothing
In the stored procedure you have to add this instruction so it works from Infopath:
SET implicit_transactions OFF;
That's all it takes. Hope it helps.
Josera