how to call a procedure in DB

Is there special setting to call a procedure,

I tried following, but not work.

cmdstr = "BEGIN poc_pmlevent(3001,0,'2006-01'," + CStr(LenBLOB) + ",'" + strArr(i) + "',121,0); END;"
cmd.CommandText = cmdstr

The sql is no problem when run in command line
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:

cn.Execute cmdstr, dbSQLPassThrough

hope this helps.
turbot_yuAuthor Commented:
it said complie error

dbSQLPassThrough not defined.
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
is cn an ADO Connection object? hmm... sorry, maybe:

cn.Execute cmdstr

Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

turbot_yuAuthor Commented:
I first use this one, no error but cannot write into DB
turbot_yuAuthor Commented:
   Dim cn As New ADODB.Connection
    Dim cmd As New ADODB.Command
    Dim cmdstr As String
turbot_yuAuthor Commented:
   cn.ConnectionString = "Provider=MSDAORA.1;" + DB2String + "Data Source=" + datasourcename + ";Persist Security Info=True;"
    cn.Mode = adModeReadWrite
    cmd.ActiveConnection = cn
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
not too sure if this is the connection string problem, i used this and works with my Oracel8i database when calling a Procedure:

cmdstr = "BEGIN poc_pmlevent(3001,0,'2006-01'," & CStr(LenBLOB) & ",'" & strArr(i) & "',121,0); END; "
ConnString="Provider=OraOLEDB.Oracle;Data Source=<<SERVER>>;User Id=<<USERID>>;Password=<<PWD>>"
Dim conn As ADODB.Connection
Set conn = New ADODB.Connection
    conn.ConnectionString = ConnString
    conn.CursorLocation = adUseClient
conn.Execute cmdstr

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
turbot_yuAuthor Commented:
the connect string no problem, tried, but still not work,
no error, but canot write into
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
make user your Procedure is working? In the sense that it allow duplicate values to save into database?
turbot_yuAuthor Commented:
in cmd line, it works, no problem
Ryan ChongBusiness Systems Analyst , ex-Senior Application EngineerCommented:
so, what's the exact problem here, can you tell me how you solve it?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.