Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Best Practices to Ensure Working with Dev DB?
Message
De
22/11/2011 11:39:01
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01529519
Message ID:
01529528
Vues:
46
>I'm writing a program to sanitize a dev database. The dev database is just a recent backup of the live database.
>
>It would be disastrous if the sanitize routine ever ran against the live database. As such, I'm taking extra measures to ensure that the program can only run against the dev database.
>
>At the beginning of the program I'm clearing out all possible lingering connection handles:
>
>LOCAL lnX
>** to ensure any open db connections are closed
>FOR lnX=1 TO 999
>	TRY
>		=SQLDISCONNECT(lnX)
>	CATCH
>		** no biggie
>	ENDTRY
>ENDFOR
>
>
>I'm verifying that the connection string in use points to the dev database.
>
>I've added a record to the master options table in the dev database which only exists in the dev database. My routine double checks that this record exists.
>
>Are there any other ideas or best practices for this? There is no such thing as too paranoid here!


In this scenario I confirm the Server and DB connection properties

If myConnection.DataSource = "myDevServer" AndAlso myConnection.Database = "myDevDB" Then...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform