Public Sub expass() If FileIO.FileSystem.DirectoryExists("c:\Arjuonsoftshield") Then FileIO.FileSystem.FileExists("c:\Arjuonsoftshield\security.sys") FileIO.FileSystem.DeleteFile("c:\Arjuonsoftshield\security.sys") Dim databaseName As String = "c:\Arjuonsoftshield\security.mdb" Dim tableName As String = "KEYS" Dim cat As ADOX.Catalog = New ADOX.Catalog() cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & databaseName & ";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Password=123;") cat = Nothing Dim con As New OleDb.OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=123;Data Source =" & databaseName) con.Open() Dim cmd As New OleDb.OleDbCommand("CREATE TABLE [" + tableName + "] ([Field1] TEXT(10), [Field2] TEXT(10))", con) cmd.ExecuteNonQuery() MessageBox.Show("Exported Successfully") con.Close() con.Dispose() System.GC.Collect() FileIO.FileSystem.RenameFile("c:\Arjuonsoftshield\security.mdb", "security.sys") Else FileIO.FileSystem.CreateDirectory("c:\Arjuonsoftshield") Dim databaseName As String = "c:\Arjuonsoftshield\security.mdb" Dim tableName As String = "KEYS" Dim cat As ADOX.Catalog = New ADOX.Catalog() cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & databaseName & ";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Password=123;") cat = Nothing Dim con As New OleDb.OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=123;Data Source =" & databaseName) con.Open() Dim cmd As New OleDb.OleDbCommand("CREATE TABLE [" + tableName + "] ([Field1] TEXT(10), [Field2] TEXT(10))", con) cmd.ExecuteNonQuery() MessageBox.Show("Exported Successfully") con.Close() con.Dispose() System.GC.Collect() FileIO.FileSystem.RenameFile("c:\Arjuonsoftshield\security.mdb", "security.sys") End If End Sub
cat.ActiveConnection.Close()
Dim cat As ADOX.Catalog = New ADOX.Catalog() cat.Create("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & databaseName & ";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Password=123;") cat = Nothing
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)