#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 246
Default Edit Query

I have code that executes a Query Edit as follows:
Sub EditQry()
'
With Selection.QueryTable
.Connection = Array(Array( _

"ODBC;DSN=Clockworks;Description=Clockworks;UID=sa ;;APP=Microsoft
Office 2000;WSID=XXXXXXXX;DATABASE=Intranet;LANGUAGE=us_e nglish;Ne" _
), Array("twork=DBMSSOCN;Address=172.30.1.110,1433"))
.CommandText = Array( _
"SELECT tbl_TimeSlips1.Year, tbl_TimeSlips1.Month,
tbl_TimeSlips1.Week, tbl_ISProjects.Description, tbl_ISPersonnel.Name,
tbl_ISPersonnel.Department, tbl_ISProjects.GLCode,
tbl_ISProjects.GLSubCode, tb" _
, _
"l_TimeSlips1.Hours, tbl_ISPersonnel.Rate, tbl_TimeSlips1.GL,
tbl_TimeSlips1.ContractorCode, tbl_TimeSlips1.ContractorName,
tbl_TimeSlips1.Charged, tbl_TimeSlips1.Notes, tbl_ISProjects.RecordID,
tbl_IS" _
, _
"Projects.Department, tbl_ISProjects.Capitalized,
tbl_ISProjects.Total, tbl_ISPersonnel.RecordID, tbl_ISPersonnel.Status"
& Chr(13) & "" & Chr(10) & "FROM Intranet.dbo.tbl_ISPersonnel
tbl_ISPersonnel, Intranet.dbo.tbl_ISProjects " _
, _
"tbl_ISProjects, Intranet.dbo.tbl_TimeSlips1 tbl_TimeSlips1" &
Chr(13) & "" & Chr(10) & "WHERE tbl_TimeSlips1.ContractorCode =
tbl_ISPersonnel.RecordID AND tbl_TimeSlips1.GL =
tbl_ISProjects.RecordID AND ((tbl_TimeSlips1.Year=200" _
, _
"5) AND (tbl_TimeSlips1.Month=11) AND (tbl_TimeSlips1.Hours0)
AND (tbl_ISProjects.Capitalized=1) AND
(tbl_ISPersonnel.Status='Associate'))" _
)
.Refresh BackgroundQuery:=False
End With
Selection.Subtotal GroupBy:=7, Function:=xlSum,
TotalList:=Array(22), _
Replace:=True, PageBreaks:=False, SummaryBelowData:=True
End Sub

The Query asks for a user name which is "sa" and a password. How and
where do I add the password to the above code to avoid the prompt. TIA

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
Query Wizard Cannot Be Used To Edit This Query Carl Excel Discussion (Misc queries) 6 October 17th 06 09:59 PM
why does edit query button not open query needlemaker Excel Discussion (Misc queries) 0 June 29th 06 03:18 PM
MS Query - unable to edit query Excel GuRu Excel Discussion (Misc queries) 9 April 12th 06 04:29 PM
Problem with MS Query - can't edit query jarems Excel Discussion (Misc queries) 2 December 12th 05 09:42 AM
Edit Query from Excel will not open query in MSQuery Michelle Excel Programming 0 February 21st 05 03:59 PM


All times are GMT +1. The time now is 08:25 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"