View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default CopyFromRecordset with large amount of data

According to :

http://msdn.microsoft.com/library/de...l=/library/en-
us/odbc/htm/odbcjetsetting_options_programmatically_for_the_ac cess_drive
r.asp

the keyword is SYSTEMDB


so this might work
(but while experimenting i locked myself (and Admin) out of the test
database : <LOL

oCN.Execute "Select * INTO Dump FROM [MS Access;Database=d:
\locked.mdb;SYSTEMDB=d:\xlSupport.mdw;Pwd=nsa].[Table1]"


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


(Jamie Collins) wrote:

keepITcool wrote

Jamie?

offtopic...

the other day tou mentioned something re protected mdb's and xls
insert.. is following what you need?

Sub MakeFromLocked()
Dim oCN As New ADODB.Connection

If Dir("d:\fromlocked.xls") < "" Then Kill "d:\fromlocked.xls"

oCN.Provider = "Microsoft.Jet.OLEDB.4.0"
oCN.Properties("Extended Properties") = "Excel 8.0;Header=Yes;"
oCN.Properties("Jet OLEDB:System database") = "D:\xlSupport.mdw"
oCN.Properties("Data Source") = "d:\fromlocked.xls"
oCN.Open UserID:="keepITcool", Password:="cia"

oCN.Execute "Select * INTO Dump FROM [MS Access;Database=d:
\locked.mdb;PWD=nsa].[Table1]" oCN.Close
Set oCN = Nothing

End Sub


keepITcool,
Thanks for this. What I actually meant, is it possible to put the path
to the System database in the sql text? i.e. within the bracketed
connection string:

Select * INTO Dump FROM [<<connection string].Table1

I strongly suspect that it is not possible.

You I think you can specify the UID and PWD but I assume it uses the
'default' workgroup file (whatever that means!) rather than a specific
workgroup file. Or, looking at your example, perhaps it just ignores
the UID and uses PWD for the database file's password. Whatever, I
don't think I'd get it to work as I would've liked.

Thanks again,

Jamie.

--