Thanks for the help. When I run this function, I get a "Compile Error:
Invalid outside procedure" and a window pops up with "Print
Sheet1.QueryTables(1).Connection"
Any ideas?
> You should be able to get connection details via VBA e.g. this in the
> Immediate Window:
[quoted text clipped - 4 lines]
>
> --
> Thanks for the help. When I run this function, I get a "Compile Error:
> Invalid outside procedure" and a window pops up with "Print
> Sheet1.QueryTables(1).Connection"
So do I <g>. Try putting a ? at the start of the line, meaning 'Print'.
BTW the line assumes your querytable is on a sheet with the codename
'Sheet1' and it is the first (or only) querytable on the sheet.
Jamie.
--
Scott Gipson - 04 Jan 2005 12:37 GMT
Got it. I get the response "ODBC;DNS=onc" . ONC is my database but when I go
to edit the query all I get is the hour glass forever and access to the
query. Any other ideas would be appreciated. Scott
> > Thanks for the help. When I run this function, I get a "Compile
> Error:
[quoted text clipped - 7 lines]
>
> --
Scott Gipson - 04 Jan 2005 12:39 GMT
I have it working and when I execute the request I now get a "ODBC:DNS=onc".
ONC is my database but I still get the hour glass when I select Edit Query.
Any additional ideas would be appreciated. Scott
> > Thanks for the help. When I run this function, I get a "Compile
> Error:
[quoted text clipped - 7 lines]
>
> --
onedaywhen - 04 Jan 2005 16:20 GMT
> I have it working and when I execute the request I now get a "ODBC:DNS=onc".
> ONC is my database but I still get the hour glass when I select Edit Query.
> Any additional ideas would be appreciated. Scott
Is the DSN missing? Control Panel, Administrative Tools, Data Sources
(ODBC) and you should be find a DSN called onc. Also look at the SQL
text e.g.
? Sheet1.QueryTables(1).CommandText
The path to the data source is sometimes repeated in the query text
itself.
Jamie.
--
Scott Gipson - 05 Jan 2005 03:13 GMT
I went to the Control Panel and found that ONC is the system DSN and even the
test connection works. SO far everything is there and everything works except
the Edit Query function. Any other ideas?
Scott
> > I have it working and when I execute the request I now get a
> "ODBC:DNS=onc".
[quoted text clipped - 14 lines]
>
> --
onedaywhen - 05 Jan 2005 09:07 GMT
> I went to the Control Panel and found that ONC is the system DSN and even the
> test connection works. SO far everything is there and everything works except
> the Edit Query function. Any other ideas?
Well, now you've found the data source (from the DSN), can you recreate
the querytable? Note, try and create a new query before you delete the
original.
Jamie.
--
Scott Gipson - 05 Jan 2005 13:51 GMT
I have tried that. When I open a blank sheet and attempt to
Get External Data / New Database Query all I get is the cursor turned into
an hourglass and nothing happens.
I was able to find the query itself in the application data folder and was
able open and edit the query but not from the Excel application. I manage
this application for 15 different people who have unique user names and this
is a real pain if I have to open / modify and save the individual queries.
Scott
> > I went to the Control Panel and found that ONC is the system DSN and
> even the
[quoted text clipped - 9 lines]
>
> --
onedaywhen - 05 Jan 2005 16:26 GMT
> I have tried that. When I open a blank sheet and attempt to
> Get External Data / New Database Query all I get is the cursor turned into
> an hourglass and nothing happens.
Ah, so you can't start MS Query at all, then? Take a look in the google
groups Usenet archive for Microsoft.Public.Excel. I see posts on this
problem on a regular basis (I don't recall see a solution ...)
Jamie.
--
Scott Gipson - 15 Jan 2005 16:39 GMT
What I discovered is that I had to have MS Access loaded in order for the
query to work. When my IT guy loaed Acess, all of my problems went away.
Thanks Again, Scott
> > I have tried that. When I open a blank sheet and attempt to
> > Get External Data / New Database Query all I get is the cursor turned
[quoted text clipped - 7 lines]
>
> --
Jamie Collins - 17 Jan 2005 08:28 GMT
> What I discovered is that I had to have MS Access loaded in order for the
> query to work.
What do you mean by 'loaded' e.g. was the driver not installed?
Jamie.
--