Parameter Markers in visual Basic

Adrian Collett

Parameter Markers in visual Basic
Dear List,

Is it possible to use parameter markers with Visual Basic ADO connecting to
DB2 OS390 ?

And if so, is it advisable from a VB programming point of view ?

Thanks,

Adrian Collett
DB2 Consultant
Milan, Italy.



Kallia Dimoka

Re: Parameter Markers in visual Basic
(in response to Adrian Collett)
Hi Adrian,

recently we have been making some tests with VB6+ADO+DB2 V5 for
OS/390 basically to establish a new security policy by capturing static sql
statements and creating "host" package lists,on which we can apply security
rules (grant execute on mypkglist.* to public).We used prepard sql
statements and parameter markers because we wanted to produce "generall" sql
statements.
Here is a program sample :
----------------------------------------------------------------------------
-------------
Set cmdupd = New ADODB.Command
Set cmdupd.ActiveConnection = cnSample
cmdupd.CommandType = adCmdText
cmdupd.CommandText = "UPDATE DSN8510.EMP " & _
"SET LASTNAME =?,FIRSTNME =?" & _
" WHERE EMPNO =?"
cmdupd.Prepared = True
Set prm1 = cmdupd.CreateParameter("LastName", adChar, adParamInput, _
15, rstSample!LASTNAME)
cmdupd.Parameters.Append prm1
Set prm2 = cmdupd.CreateParameter("FirstNme", adChar, adParamInput, _
12, rstSample!FIRSTNME)
cmdupd.Parameters.Append prm2
Set prm3 = cmdupd.CreateParameter("EmpNo", adChar, adParamInput, _
6, rstSample!EMPNO)
cmdupd.Parameters.Append prm3
cmdupd.Execute
----------------------------------------------------------------------------
-----------------
This works fine for us,as the capture file contains ths parameter markers
and not actual values.Hope this might help......

Best Regards,

Kalliopi Dimoka
Athens,Greece

> ----------
> From: Adrian Collett[SMTP:[login to unmask email]
> Reply To: DB2 Data Base Discussion List
> Sent: ÐÝìðôç, 21 Äåêåìâñßïõ 2000 10:13 ðì
> To: [login to unmask email]
> Subject: Parameter Markers in visual Basic
>
> Dear List,
>
> Is it possible to use parameter markers with Visual Basic ADO connecting
> to
> DB2 OS390 ?
>
> And if so, is it advisable from a VB programming point of view ?
>
> Thanks,
>
> Adrian Collett
> DB2 Consultant
> Milan, Italy.
>
>
> visit
>
>
>