Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Excel 2007 Show Columns Error

I have a small app that allows me to run SQL queries to grab data through a
DSN (MySQL ODBC Connector 3.51) and dump it into a spreadsheet in Excel.

The app works great in Excel 2003. In Excel 2007, however, using SHOW
COLUMNS FROM `table_name` or DESCRIBE `table_name` results in run-time
error 1004:

No columns that Microsoft Office Excel can use were returned from this
query.

This is the code. It runs through a user form. I type the SQL into TextBox1
and click CommandButton1.

Private Sub CommandButton1_Click()
Dim oQueryName As String
oQueryName = Format(Date, "yyyy-mm-dd") & Chr(95) & Format(Time, "hh-mm-ss")
With ActiveSheet.QueryTables.Add(Connection:="ODBC;DSN= MyODBC",
Destination:=Selection)
.CommandText = RunQueryForm.TextBox1.Value
.Name = oQueryName
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = False
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False
.EnableRefresh = True
End With
If Not CheckBox1.Value Then
'delete the query table. this is equivalent to unchecking "Save query
definition."
ActiveSheet.QueryTables.Item(oQueryName).Delete
End If
Unload Me
End Sub

So far there hasnt been a lot of information on Excel 2007, so any help you
can offer is greatly appreciated.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default Excel 2007 Show Columns Error

The problem was the MySQL ODBC Connector. I inadvertently installed the
latest version 3.51.15 which doesn't work. I uninstalled and backed up to
version 3.51.12. Works perfectly now on both Excel 2003 and Excel 2007.

Whew. I thought it was going to be some nasty Vista incompatibility.
Amazingly, my entire application runs perfectly on Vista.

Problem solved.
Reply
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
Excel 2007 - error saving file & error loading dll TinaF Excel Discussion (Misc queries) 0 July 1st 09 01:49 PM
Excel: show the row when either one of the columns is0 vicki Excel Discussion (Misc queries) 2 January 15th 09 05:51 AM
Show all columns in Excel Jenny O17 Excel Discussion (Misc queries) 1 November 13th 06 02:19 PM
Excel 2007 extra columns - but transposing columns still not working! [email protected] Excel Programming 0 July 26th 06 02:58 PM
Excel 2007 Beta 2 Error -- Text-to-Columns Wizard Data preview wha Bob from Yorktown Excel Discussion (Misc queries) 0 May 28th 06 03:49 PM


All times are GMT +1. The time now is 08:33 PM.

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

About Us

"It's about Microsoft Excel"