Q:

VBA 2010 Add Query Table: Application-defined or Object-Defined Error

If it were functioning properly, the following code would grab the name of a table from a textbox, concatenate it with 'describe ' and then put the results in a query table.  As it stands, the code fails with 'Run Time Error 1004: Application-Defined or Object-Defined error'
Private Sub cmdNew_Click()

Dim TableName As String
Dim NewSheet As Excel.Worksheet
Dim ConnString As String
Dim SQLStatement As String

ConnString = ConnString = "DSN=REMOVED;UID=REMOVED;;DBQ= REMOVED;DBA=W;APA=T;EXC=F;FEN=T;QTO=T;FRC=10;FDL=10;LOB=T;RST=T;BTD=F;BNF=F;BAM=IfAllSuccessful;NUM=NLS;DPM=F;MTS=T;MDI=F;CSR=F;FWC=F;FBS=64000;TLO=O;MLD=0;ODA=F;"
TableName = ActiveSheet.txtTableName.Text
SQLStatement = "desc " & TableName

Set NewSheet = Sheets.Add
NewSheet.Name = TableName

Set qry = NewSheet.QueryTables.Add(ConnString, NewSheet.Range("A1"), SQLStatement)
qry.Refresh

End Sub

A:

Assuming you are querying an Oracle DB, the DESC keyword is for sorting a column in descending order, try using the keyword DESCRIBE in full.
If that doesn't work then run your query against the DB server outside of Excel, and see if it gives you a more helpful message?

