hey guys. is it possible to drop an MS Access Database using Oledb in VB.Net?
if yes, then how?
i've been searching from Google but can't find any answer.

suppose u want to delete table named "temp" in Database1.mdb
First Imports:

Imports System.Data.OleDb

then u can write following code on button click

Dim cn As OleDbConnection
        Dim cmd As OleDbCommand

        cn = New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Database1.mdb;")
        Dim strQ As String = String.Empty
        strQ = "DROP TABLE temp"

        cmd = New OleDbCommand(strQ, cn)

        cn.Open()
        cmd.ExecuteNonQuery()
        cn.Close()

what i wanted to delete is the database itself.
anyway i already solved it by deleting the access file. :)
thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.