VB.NET连接 [英] VB.NET Connectivity

查看:64
本文介绍了VB.NET连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hie EvreryOne!



我想知道如何在Vb.NET中连接MS ACCESS数据库?

解决方案

谷歌。你可能会找到一个让你非常轻松的图书馆。



如果你不打算自己搜索它,那么没有人会去来帮助你。 :doh :: doh:


this [ ^ ]并获得了这些以及更多!

http://www.startvbdotnet.com/ado/msaccess.aspx [ ^ ]

http://www.astahost.com/info.php/vbnet-ms-access-interaction-tutorial -part_t12054.html [ ^ ]


 Imports System.Data.Oledb 


Dim con As New OledbConnection( Provider = microsoft.Jet.oledb.4.0DataSource = D:\ mydata.mdb;

Dim cmd 作为新OledbCommand

公共 var1 作为字符串

公共 Sub New()
con。打开()

cmd.Connection = con
cmd.CommandText = SELECT * FROM table1

End Sub

Public Sub created()
cmd.C ommandText = INSERT INTO table1(Neyms)VALUES(' + var1 + ')
cmd.ExecuteNonQuery()

结束 Sub


Hie EvreryOne!

I want to know how to connect MS ACCESS database in Vb.NET ?

解决方案

Google. You'll probably find a library that will make it incredibly easy for you.

If you aren't going to search for it yourself, then no-one is going to help you. :doh: :doh:


Did this [^]and got these and many more!
http://www.startvbdotnet.com/ado/msaccess.aspx[^]
http://www.astahost.com/info.php/vbnet-ms-access-interaction-tutorial-part_t12054.html[^]


Imports System.Data.Oledb


    Dim con As New OledbConnection("Provider=microsoft.Jet.oledb.4.0DataSource=D:\mydata.mdb;")

    Dim cmd As New OledbCommand

    Public var1 As String

    Public Sub New()
        con.Open()

        cmd.Connection = con
        cmd.CommandText = "SELECT * FROM table1"

    End Sub

    Public Sub creates()
        cmd.CommandText = "INSERT INTO table1(Neyms) VALUES('" + var1 + "')"
        cmd.ExecuteNonQuery()

    End Sub


这篇关于VB.NET连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆