Mackin, Christopher
CMackin at Quiznos.com
Wed Jul 7 10:43:44 CDT 2004
Martin, You should be able to loop through the query defs and update the .Connect property of all your Pass-Thru's Here's something I wrote to handle this in the past, you'll want to examine the current .Connect property and modify as needed. The code below can be used to set to the "new" settings and also used to convert back to production settings: Sub QDFUpdating(blnSetToNew As Boolean) Dim db As DAO.Database Dim qdf As DAO.QueryDef Dim strConnect As String If blnSetToNew Then strConnect = "ODBC;DSN=AFD_SQL;DATABASE=AFD;Trusted_Connection=Yes" Else strConnect = "ODBC;DSN=AFDStoreData;DATABASE=MFD;Trusted_Connection=Yes" End If Set db = CurrentDb For Each qdf In db.QueryDefs If Left(qdf.Connect, 4) = "ODBC" Then qdf.Connect = strConnect Next qdf Set qdf = Nothing Set db = Nothing End Sub -Chris Mackin -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Martin Reid Sent: Wednesday, July 07, 2004 9:11 AM To: Access Developers discussion and problem solving Subject: [AccessD] Pass Throughs I am setting up a system I created on my machine at home. I am currently in the USA. Access 2000 - SQL Server 2000. Is there away to automatically change the properties of all Pass Through Queries to reflect the local set up rather than doing it manually?? The server name is different but other than that all other areas are fine? I saved the properties locally at home. Rocky - see you on Sunday (<: Of course any other suggestions comments welcome. Martin -- _______________________________________________ AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com