LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Problems with .Refresh BackgroundQuery:=False


Hello!!!!

My name is David and I'm a Spanish boy so perhaps my English is not as
good as it would be in order to explain my problem, but I'll try.

First of all, thank you in advance for all your help because I'm sure
that with your support my application will work in a good way.

The problem is that I've got the next piece of code:

Sub Busqueda(Dia As Date)
'
' Busqueda Macro
' Macro grabada el 04/07/2005 por s602043
'

'
With ActiveSheet.QueryTables.Add(Connection:= _
"ODBC;DSN=*****;UID=SMP;PWD=****;SERVER=****;" ,
Destination:=Range( _
"A7"))
..CommandText = Array( _
"SELECT T_BLOC_ARRET.I_ZON_NUMERO,
T_BLOC_ARRET.C_BA__DATE_DE_DEBUT, T_BLOC_ARRET.C_BAP_LIBELLE_ARRET,
T_POSTE_ARCHIVE.I_HPO_DATE" & Chr(13) & "" & Chr(10) & "FROM
SMP.T_BLOC_ARRET T_BLOC_ARRET, SMP.T_POSTE_ARCHIVE T_POSTE_ARCHIV" _
, _
"E" & Chr(13) & "" & Chr(10) & "WHERE T_BLOC_ARRET.I_HPO_NUMERO
= T_POSTE_ARCHIVE.I_HPO_NUMERO AND T_BLOC_ARRET.I_ZON_NUMERO =
T_POSTE_ARCHIVE.I_ZON_NUMERO AND T_BLOC_ARRET.C_BA__DATE_DE_DEBUT " &
Dia & " AND ((T_BLOC_ARRET.I_ZON_NUMERO=1002))")
..Name = "Consulta desde *****"
..FieldNames = True
..RowNumbers = False
..FillAdjacentFormulas = False
..PreserveFormatting = True
..RefreshOnFileOpen = False
..BackgroundQuery = True
..RefreshStyle = xlInsertDeleteCells
..SavePassword = True
..SaveData = True
..AdjustColumnWidth = True
..RefreshPeriod = 0
..PreserveColumnInfo = True
..Refresh BackgroundQuery:=False
End With
End Sub

I've got a form that gets information from the user (this information
is the date), after that, a macro that is called "Busqueda" receives
the information from the form and executes some SQL code. I think that
the main problem is when the information is sent to the worksheet but I
don't know because the error that appears on the screen is:

Error 1004, ODBC connection

Then, a yellow narrow points to the line:

..Refresh BackgroundQuery:=False

What can I do with this error?????.

I'm in a hurry so please!!!!!! answer me as soon as possible.

Thank you, David.


--
dmplacebo
------------------------------------------------------------------------
dmplacebo's Profile: http://www.excelforum.com/member.php...o&userid=25095
View this thread: http://www.excelforum.com/showthread...hreadid=386070

 
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
Problems with .Refresh BackgroundQuery:=False dmplacebo Excel Worksheet Functions 0 July 11th 05 12:39 PM
Refresh BackgroundQuery fails JMMach[_2_] Excel Programming 3 June 12th 05 03:10 PM
Error on refresh backgroundquery - help please RichardLOZ Excel Programming 7 February 6th 05 11:49 PM
Web query .Refresh BackgroundQuery:=False problem Jim[_55_] Excel Programming 1 January 26th 05 04:08 PM
Excel does not close from VB!! (when i refresh Refresh query with BackgroundQuery:=False) Anant[_2_] Excel Programming 1 August 6th 03 04:22 AM


All times are GMT +1. The time now is 08:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"