L
LauraBethBrown
I can't seem to be able to retrieve data from temporary tables. Is
something missing from my code? I can select the top ten form the
table and can select it into the temp table #lb, but I get nothing when
I try to retrieve the data from the temp table. Can anyone help?
Sub EmailSQLs()
Dim qt As QueryTable
sqlstr = "select top 10 * into #lb from dim_email" + _
" select * from #lb"
connstring = _
"ODBC;DSN=test;UID=;PWD=;Database=Kpi"
With ActiveSheet.QueryTables.Add(Connection:=connstring,
Destination:=Range("A1"), SQL:=sqlstr).Refresh
End With
End Sub
something missing from my code? I can select the top ten form the
table and can select it into the temp table #lb, but I get nothing when
I try to retrieve the data from the temp table. Can anyone help?
Sub EmailSQLs()
Dim qt As QueryTable
sqlstr = "select top 10 * into #lb from dim_email" + _
" select * from #lb"
connstring = _
"ODBC;DSN=test;UID=;PWD=;Database=Kpi"
With ActiveSheet.QueryTables.Add(Connection:=connstring,
Destination:=Range("A1"), SQL:=sqlstr).Refresh
End With
End Sub