Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default database calls

If there's no direct ADO/DAO calls, what about QueryTables ?
Run this code to see what you get:

Private Sub CommandButton2_Click()
Dim WS As Worksheet
Dim QT As QueryTable
Dim QTCount As Long

For Each WS In ThisWorkbook.Worksheets
For Each QT In WS.QueryTables
Debug.Print QT.Parent, QT.CommandText
QTCount = QTCount + 1
Next
Next

MsgBox "There are " & QTCount & " query tables in this workbook."

End Sub

NickHK

"Panos Stavroulis." wrote in
message ...
Hi,

I am trying fix an error message from the database coming into excel after
you press a button, ie run a macro. It produces some syntax error on the
database and it fails.

I can see that the button is assigned to a macro, then I can see all

macros
and I've searched through them for opening database connections, ie ADO
calls. I can't see anything connecting to a database. Also profiler on SQL
Server doesn't show anything (maybe the request goes to the wrong server?)

I
can't see any external data queries either.

What else is in an excel file that can make calls to a DBMS? Thanks.

Panos.



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default database calls

That worked thanks. I still can't see the queries, something with my odbc
set-up but at least now I can see the sql code. Thanks.

"NickHK" wrote:

If there's no direct ADO/DAO calls, what about QueryTables ?
Run this code to see what you get:

Private Sub CommandButton2_Click()
Dim WS As Worksheet
Dim QT As QueryTable
Dim QTCount As Long

For Each WS In ThisWorkbook.Worksheets
For Each QT In WS.QueryTables
Debug.Print QT.Parent, QT.CommandText
QTCount = QTCount + 1
Next
Next

MsgBox "There are " & QTCount & " query tables in this workbook."

End Sub

NickHK

"Panos Stavroulis." wrote in
message ...
Hi,

I am trying fix an error message from the database coming into excel after
you press a button, ie run a macro. It produces some syntax error on the
database and it fails.

I can see that the button is assigned to a macro, then I can see all

macros
and I've searched through them for opening database connections, ie ADO
calls. I can't see anything connecting to a database. Also profiler on SQL
Server doesn't show anything (maybe the request goes to the wrong server?)

I
can't see any external data queries either.

What else is in an excel file that can make calls to a DBMS? Thanks.

Panos.




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
Calls per Day Nate Excel Discussion (Misc queries) 1 September 17th 08 09:59 PM
database calls Tim Williams Excel Programming 1 January 18th 07 12:31 AM
Concurrent Calls Andrew[_43_] Excel Programming 1 May 20th 04 09:25 PM
XLA calls dll rodt Excel Programming 2 November 17th 03 10:08 PM
VBA Calls Rob Bovey Excel Programming 4 August 23rd 03 05:32 AM


All times are GMT +1. The time now is 09:48 AM.

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"