Original content

Protected by Copyscape Plagiarism Checker

Saturday, May 15, 2010

Stored procedure/SQL query of MS Access in VB.Net

Dim prov As String = "Microsoft.Jet.OLEDB.4.0"
Dim pass As String = "123"
Dim con As New OleDb.OleDbConnection("Provider=" + prov + ";Data Source=" + "F:\Perfect Engineering\Perfect Engineering\Perfect Engineering\bin\Debug\Perfect_Engineering.mdb;Jet OLEDB:Database Password=" + pass)
Dim cmd As New OleDb.OleDbCommand
Dim dr As OleDb.OleDbDataReader
con.Open()
cmd.Connection = con
cmd.CommandType = CommandType.StoredProcedure
cmd.CommandText = "delivery_pending"
dr = cmd.ExecuteReader
If dr.Read() Then
   MsgBox(dr(0))
End If

No comments:

Post a Comment