View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
TAD from DBL TAD from DBL is offline
external usenet poster
 
Posts: 9
Default using SQL against Excel tables

How can I just use SQL against tables right in Excel? Why won't something
like this work? Why would I have to open up a channel when I just want to
work with an excel table?

Dim Querystring As String
Dim DatabaseName As String
DatabaseName = "testtable"
QueryString = "SELECT * FROM testtable.field_three WHERE
(testtable.field_one="yes")"
Chan = SQLOpen(DNS??& testtable)
SQLExecQuery Chan, Querystring
Set Output = Worksheets("Sheet1").Range("A1")
SQLRetrieve Chan, Output, , , True
SQLClose Chan
End Sub








--
Please contact me by email if you have an answer to this question. I
appreciate it.