PC Review


Reply
Thread Tools Rate Thread

Changing ODBC Connection between development and production

 
 
Molasses26
Guest
Posts: n/a
 
      20th Oct 2008
I know I've seen an explanation of this somewhere but I can't, for the life
of me, find it again now that I need it!

I have an Access front-end app attached to tables on a SQL server and I have
set up a number of functions to execute pass-through queries and stuff. What
I need is a way to change all the connection strings when I switch from
Developement to Production environments.

Switching between "DSN=BillingServicesDSN" and "DSN=BillingServicesProdDSN"

It wasn't too bad when I just had one or two but it's getting a little
out-of-hand now and I need to clean this up.
Thanks!

Here is an example of one of the functions:
Public Function ExecAgingReport(datToDate As String, datFromDate As String)
Dim db As Database
Dim qd As QueryDef
Set db = CurrentDb ' Setting the database as current Database
db.QueryDefs.Delete ("spr_AgingReport") 'deleting the old defination of
pass-through query
Set qd = db.CreateQueryDef("spr_AgingReport") 'define new query defination
qd.ReturnsRecords = True ' Query does retrieve records
qd.Connect = "ODBC;DSN=BillingServicesDSN"
qd.SQL = "Exec spr_AgingReport " & "'" & datToDate & "'" & ", " & "'" &
datFromDate & "'"
qd.ReturnsRecords = True ' Query does retrieve records
qd.Close
End Function


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing and Adding data through ODBC connection Bob Microsoft Excel Misc 0 3rd Nov 2008 05:04 PM
Production vs. development gsauns Microsoft ASP .NET 2 13th Sep 2007 08:42 PM
Database Connection - Development to Production Matt Microsoft Dot NET 5 19th May 2006 04:57 AM
Development vs. Production Jerry Camel Microsoft ASP .NET 2 26th Apr 2005 06:27 PM
Development/Production Box .Net =?Utf-8?B?UGF0cmljay5PLklnZQ==?= Microsoft ASP .NET 2 9th Nov 2004 12:26 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:02 AM.