打印本文 打印本文 关闭窗口 关闭窗口
在VB.NET中使用MS Access存储过程 — 第一部份
作者:武汉SEO闵涛  文章来源:敏韬网  点击数2052  更新时间:2009/4/23 19:01:01  文章录入:mintao  责任编辑:mintao

    Sub CreateStoredProc(ByVal sSQL As String)
        Dim con As OleDbConnection
        Dim cmd As OleDbCommand = New OleDbCommand()
        Dim da As OleDbDataAdapter

        '''' Change Data Source to the location of Northwind.mdb on your local 
        '''' system.
        Dim sConStr As String = "PROVIDER=Microsoft.Jet.OLEDB.4.0;Data " _
            & "Source=C:\Program Files\Microsoft " _
            & "Office\Office10\Samples\Northwind.mdb"

        con = New OleDbConnection(sConStr)

        cmd.Connection = con
        cmd.CommandText = sSQL

        con.Open()
        cmd.ExecuteNonQuery()
        con.Close()

    End Sub


End Module

 

上一页  [1] [2] 

打印本文 打印本文 关闭窗口 关闭窗口