Write a program that overwrites Oracle Date Display Format with BCB

zhaozj2021-02-16  46

Write a program that overwrites Oracle Date Display Format with BCB

#include #pragma hdrstop # include #include "unit1.h" // ------------------------ -------------------------------------------------- - # Pragma package (smart_init) #pragma resource "* .dfm" TFORM1 * FORM1; // --------------------------- ---------------------------------------------__ fastcall tform1 :: TFORM1 (TComponent * Owner: TFORM (OWNER) {} // ----------------------------------- ---------------------------------------- void __fastcall tform1 :: button1click (Tobject * Sender ) {// read the registry TRegistry * RegLiveFpcnR = new TRegistry; try {RegLiveFpcnR-> RootKey = HKEY_LOCAL_MACHINE;! if (RegLiveFpcnR-> OpenKey ( "// SOFTWARE // ORACLE", true) = false) CSpinEdit1-> Text = REGLIVEFPCNR-> ReadString ("NLS_DATE_FORMAT");} __finally {reglivefpcnr-> closekey (); delete reglivefpcnr;}} // ----------------------- -------------------------------------------------- - void __fastcall tform1 :: button2click (TOBJECT * Sender) {// write registry Tregistry * reglivefpcnw = new Tregistry; try {reglivefpcnw-> rootkey = HKEY_LOC Al_Machine; if ("// Software // Oracle", true! = False) reglivefpcnw-> Writestring ("NLS_DATE_FORMAT", TRIM (cspinedit2-> text.c_str ())); showMessage ("Date The format is successful! ");} __Finally {reglivefpcnw-> closekey (); delete reglivefpcnw;}} // ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------- void __fastcall tform1 :: FormShow (TOBJECT * Sender) {cspinedit2-> items-> add ("YYYY-MM-DD"); cspinedit2-> items-> add ("YYYY / MM / DD"); cspinedit2-> items-> add (" MM-DD-YYYYYYYYY "); cspinedit2-> items-> add (" mm / dd / yyyy "); cspinedit2-> items-> add ("

转载请注明原文地址:https://www.9cbs.com/read-26898.html

New Post(0)