In trying to update an ACCESS2003 database from VB2005 using OleDB, I have run into a problem of needing to provide a password to access the source database when using the INSERT command. Here is the code I am using to move the data.
Code:If UpdateRequired = True Then 'Old Database exists... Repopulate the new database Dim strSQL As String Dim conString As String = My.Settings.ScoreboardConnectionString Dim conn As OleDb.OleDbConnection = New OleDb.OleDbConnection(conString) Dim command As OleDb.OleDbCommand strSQL = "INSERT INTO tbl_GameData " strSQL = strSQL & "Select * From tbl_GameData in " & "'" & StrPath & "\" & SourceDBFileName & "'" Console.WriteLine(strSQL) command = New OleDb.OleDbCommand(strSQL, conn) conn.Open() command.ExecuteNonQuery() conn.Close() conn.Dispose() End If
Is there a way to provide the password the the source database or will need to open a second connection and use a different INSERT strategy?




Reply With Quote