RSS

Displaying data in the Stored Procedure With Parameter.

Stored Procedure is a program stored in the data base as well as data. It is actually quite unusual, because we expect the stored data in the development of data base is not his program.

The core competency is in SQL Server Store Procedures and Functions (Functions only found in SQL Server 2000).
With the Store Procedure, then the SQL program that we created:
  • can be used anytime.
  • more quickly and efficiently because it is Server Side.
  • easily created and maintained by a small but 'Power Full'.

Strored Making Procedure.
Syntax:

CREATE PROCEDURE nama_procedure
[@ Parameter1 tipe_data_parameter1, ... ... ... .., [@ ParameterNtipe_data_parameterN]
U.S.
SQL or TSQL statement

TSQL is the development of SQL, thus becoming more Powerful.
The following store procedure creation through the Enterprise Manager:
  • Click Stored Procedure in Database Northwind.
  • Right click on Area Name.
  • Select New Stored Procedure.







Change the statement that there is a Stored Procedure the following:



Then To display the data into a form using a stored procedure, create a form like the following picture:


The following program code:

Dim Conn As New ADODB.Connection
Dim rsTransaksi As New ADODB.Recordset
Dim StrSQL As String, OpenConnecting As String

Private Sub Form_Load()
Dim CustomerId As String
 
  CustomerId = InputBox("Please Input Customer ID !")
 
  OpenConnecting = "Provider=SQLOLEDB.1;Persist Security Info=False;" _
      & "User ID=sa;Initial Catalog=NorthWind;Data Source=(local)"
      
  If Conn.State = adStateOpen Then
    Conn.Close
    Set Conn = New ADODB.Connection
    Conn.Open OpenConnecting
  Else
    Conn.Open OpenConnecting
  End If
 
  rsTransaksi.ActiveConnection = Conn
  rsTransaksi.CursorLocation = adUseClient
  rsTransaksi.CursorType = adOpenDynamic
  rsTransaksi.LockType = adLockOptimistic
  rsTransaksi.Open "EXEC CustOrderHist '" & CustomerId & "'"
 
  Set DataGrid1.DataSource = rsTransaksi
 
End Sub




The result:




  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS

Free sample Database Source Code

Tools Application


Generate Barcode
RFID Communicated


Database Application

Access To XML
Ado Client-Side
Books File
Complate Ado Sample APP
Connect To Oracle
Create Database
Database XML
Hotel System
Import Data from Access to SQL Server
Library Application


Aplikasi untuk Lembaga Pendidikan
Aplikasi Inventory Menggunakan Komponen DAO
Aplikasi Shipping
Aplikasi Sistem Pakar untuk Pendeteksian Kerusakan Motor
 

Date & Math 


Calculator 1
Calculator 2
Calculator 3
Calculator 4
Convert your system Date to MM/dd/yyyy
Calendar 1
Calendar 2
Blowfish to VB


Files & Directories

Build Test Files
Change a File extension
Change the archive and read-only Attributes of a File
Create a File Association with default icon
Copy Multiple File
Delete a File
Delete Empty
Detect if a File exists
Determain if a File Exists
Drive Browser
File Counter
File Function
File Splitter
File System
Find File
Create Folder
INI File
INI File Manager
My Explorer
Open a Files with its Associated Application

Form Control

3D Labels Controls
3D Data Array
Action Button
Add a 3D Effect to Form, Textboxes, and Labels
Add Columns and Titles Effortlessly to a ListView Control
Align Flexgrid Cells after Adding a Row or Column
Animated Form Unload
Auto-complete Combo Box
Gurhan Button
hoverbutton




Office and Visual Basic


Access Text to Speech Soap
Add Custom Properties to Excel File
Convert Text Cel to String
Create Excel Files
Create Word Documents Files
Data to Word Documents
Using Microsoft Word from Visual Basic for Reporting
Conversion Excel to Access
Excel and VB
Excel and VB With Database
VB with Excel
Excel to Access
Excel To XML
Excel via VB
Create Help Files
Microsoft Acces Password Recovery
Send Email
Send and Received Email
VB to Excel
VB To Word

  • Digg
  • Del.icio.us
  • StumbleUpon
  • Reddit
  • RSS