When I execute the following code a Dr. Watson error occurs, however
without the connection 'close' line included the data is retrieved
perfectly. Please can anyone help - it's driving me mad!! Not sure whether
it is my code or perhaps the system setup.
I am trying to connect to a Sybase Database using Excel 97 (VBA)
Dim ws As Workspace, rs As Recordset, qt As QueryTable, c As Connection,
ConnectStr As String
Set ws = CreateWorkspace("ODBCDirect", "admin", "", dbUseODBC)
Set c = ws.OpenConnection("fosdeal", 1, False, ConnectStr)
Set rs = c.OpenRecordset("SELECT * FROM WK_HOLDINGS")
Set qt = Sheets("Sheet1").QueryTables.Add(rs, Range("a1"))
c.Close 'This line is where the application crashes!!!!!
Thanks in advance.