Activeworkbook as ADODB?
- From: "Christian Meier" <tomtailor@xxxxxxxxxxx>
- Date: 28 May 2006 01:34:22 -0700
hello!
I am able to enquery closed Excel-Files like this
Dim cn, rs, cmd
Set cn = CreateObject("ADODB.Connection")
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=MyFile.xls;" & _
"Extended Properties=""Excel 8.0;HDR=Yes;"";"
Set cmd = CreateObject("ADODB.Command")
cmd.ActiveConnection = cn
cmd.CommandText = "SELECT * from ... "
Set rs = cmd.Execute
But my Question is: Is there any way to set the activeworkbook as
Datasource? I would like to enquery the active Excel from a VBA Macro.
The issue is, that I have to do some Joins and "sverweis" is not
functional enough. And I do not like "for i = 1 to 64000 ... if
cells(x,y)=foo ..." as much as select * from sheet1 s, sheet2, s2 where
s1.foo = s2.foo ....
THX
Christian Meier
.
- Prev by Date: Re: [ADO] Database connection problem.
- Next by Date: Re: DataAdapter update on tables with referential integrity enforced
- Previous by thread: SQL Server 2005 with SQLNCLI is not allowing CREATE DATABASE
- Next by thread: Re: DataAdapter update on tables with referential integrity enforced
- Index(es):