A
Avi
Hi,
I am connecting to DB2 from Excel using IBM OBDC driver. I am able to
connect and getting the data but.. there is a window that pops up
asking me to select the database.. is there a way to get rid of it
here is my code.
With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;Driver={IBM DB2 ODBC
DRIVER};Hostname=udb_db2t.xxxxx;Port=2001;DB=DB2T;Uid=xxx;Pwd=xxxxx;"
_
, Destination:=Range("A1"))
.CommandText = strQueryText
.Name = strQueryName
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = True
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.EnableRefresh = True
.EnableEditing = False
.Refresh BackgroundQuery:=False --- this row pops the
window...
End With
I also see the error message in the window "SQL1013N The database
alias name or database name "" could not be found. SQLSTATE=42705"
looks like i am not defining the database properly..
Can someone please help ..
Thanks
Avinash
I am connecting to DB2 from Excel using IBM OBDC driver. I am able to
connect and getting the data but.. there is a window that pops up
asking me to select the database.. is there a way to get rid of it
here is my code.
With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;Driver={IBM DB2 ODBC
DRIVER};Hostname=udb_db2t.xxxxx;Port=2001;DB=DB2T;Uid=xxx;Pwd=xxxxx;"
_
, Destination:=Range("A1"))
.CommandText = strQueryText
.Name = strQueryName
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = True
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.PreserveColumnInfo = True
.EnableRefresh = True
.EnableEditing = False
.Refresh BackgroundQuery:=False --- this row pops the
window...
End With
I also see the error message in the window "SQL1013N The database
alias name or database name "" could not be found. SQLSTATE=42705"
looks like i am not defining the database properly..
Can someone please help ..
Thanks
Avinash