Stored Procedure


Private cnn As ADODB.Connection

Private Sub Form_Load()

Set cnn=New ADODB.Connection

cnn.ConnectionString=”Provider=Microsoft.Jet.OLEDB.4.0;”&”Data Source=_

” & App.Path & “\TTVB2.mdb;”

cnn.Open

‘stored procedure

Me.txtSP.Text=”Create Procedure SupProc AS” & “Select TdSup,Nama,Alamat_

,Telp From Supplier”

End Sub

Private Sub cmdCreate_Click()

On Error Resume Next

cnn.Execute Me.txtSp.text

Debug.Print “StoredProcedure created”

Dim rs As NewADODB.RecordSet

rs.CursorLocation=adUseClient

rs.Open “Execute SupProc”, cnn

Set me.grd.DataSource=rs

End Sub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s