LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 202
Default Working with protected Databases Access through Excel

I have 2 protected databases in Access, and I'm manipulating the information
through Codigos VBA from Excel. But my problem resides when I use the
instruction SELECT INTO... IN '[Target Database]' because the database target
is protected even, and I don't know how to include the password.

I made the following:

Dim cnnX As New ADODB.Connection
Set cnnX = New Connection
dbName = ("C:\Data\DataBase1.mdb")
With cnn
.Provider = "Microsoft.Jet.OLEDB.4.0"
.Mode = adModeWrite
.Properties("Jet OLEDB:Database Password") = "abc"
.Open dbName
End With

'Create the recordset
Dim rs As ADODB.Recordset
Set rs = New Recordset

'Determines what records to show
Dim strSQL As String
strSQL = "SELECT myTable.* INTO myNewTable IN 'C:\Data\DataBase2.mdb'
FROM myTable "

'Retreive the records
rs.CursorLocation = adUseClient
rs.Open strSQL, cnn

'close connection
cnnX.Close
Set cnnX = Nothing
Set rs = Nothing


Please, help me soon!

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF is not working on a protected sheet in Excel 2003 CarpeDiem Excel Discussion (Misc queries) 1 February 10th 09 09:16 PM
Import Access Data from 3 databases into 1 worksheet *ERROR* I need help please Excel Discussion (Misc queries) 0 April 22nd 08 07:29 PM
how to access databases from excel using ms query and odbc? Nabin Excel Discussion (Misc queries) 0 October 11th 06 07:32 AM
Security for Viewing MS Access Databases From Excel Datasource Sam Wardill Excel Discussion (Misc queries) 0 March 28th 06 03:47 PM
Open PW-Protected MS Access db using Excel VBA Mike Excel Programming 1 February 2nd 05 07:00 PM


All times are GMT +1. The time now is 01:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"