Public Sub expass() If FileIO.FileSystem.FileExists("c:\security.sys") Then FileIO.FileSystem.DeleteFile("c:\security.sys") Dim databaseName As String = "c:\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.ActiveConnection.Close() cat = Nothing Dim con As New OleDb.OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=ad1e2e$pba#k2;Data Source =" & databaseName) con.Open() Dim cmd As New OleDb.OleDbCommand("CREATE TABLE [" + tableName + "] ([Key] TEXT(10))", con) cmd.ExecuteNonQuery() cmd = Nothing MessageBox.Show("Exported Successfully") con.Close() con.Dispose() con = Nothing FileIO.FileSystem.RenameFile("c:\security.mdb", "security.sys") Else Dim databaseName As String = "c:\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.ActiveConnection.Close() cat = Nothing Dim con As New OleDb.OleDbConnection("PROVIDER=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Database Password=ad1e2e$pba#k2;Data Source =" & databaseName) con.Open() Dim cmd As New OleDb.OleDbCommand("CREATE TABLE [" + tableName + "] ([Key] TEXT(10))", con) cmd.ExecuteNonQuery() cmd = Nothing MessageBox.Show("Exported Successfully") con.Close() con.Dispose() con = Nothing FileIO.FileSystem.RenameFile("c:\security.mdb", "security.sys") End If End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)