Changing ODBC Connection between development and production

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



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


.



Relevant Pages

  • ADO exception with character combination inside string...
    ... We also have various Delphi7 programs that operate on this database. ... These programs are set up to trap the exception in an ADO operation ... and log the query text that was in use when the exception happened. ... What happens is that if we have a string to store inside the database ...
    (borland.public.delphi.database.ado)
  • Row Level Locking from Excel VBA query
    ... There are multiple users accessing the database at ... query that I am using so that two users will not get the same order ... Dim dbsConn As ADODB.Connection ... Dim connString As String ...
    (microsoft.public.access.queries)
  • Re: Fastest String search
    ... I have to query the database with the string from text file. ... By this I mean writing your own Binary File Access method and reading the Oracle database records without using any database engine. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Date extraction
    ... I don't know which database you're using, ... Assuming, for now, that you're reading these dates as text strings then the ... Dim sDateString As String ... did you mean a VB query or a SQL query? ...
    (microsoft.public.vb.general.discussion)
  • Re: SQL query will not return any records
    ... > I have the following code to retrieve records from an access table ... > database. ... If I run a query using a linked table it returns all ... > Set rs1 = dbAcc.OpenRecordset(MYSQL, dbOpenSnapshot, ...
    (microsoft.public.access.queries)