CSDN博客

img huguangtao

用BCB编写一个改写oracle日期显示格式的程序

发表于2002/7/5 9:23:00  742人阅读

用BCB编写一个改写oracle日期显示格式的程序

 
 

#include <vcl.h>
#pragma hdrstop
#include <Registry.hpp>
#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)
{
//读注册表
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)
{
//写注册表
TRegistry *RegLiveFpcnW = new TRegistry;
 try
 {
  RegLiveFpcnW->RootKey = HKEY_LOCAL_MACHINE;
  if(RegLiveFpcnW->OpenKey("//SOFTWARE//ORACLE",true) != false)
  RegLiveFpcnW->WriteString("NLS_DATE_FORMAT",Trim(CSpinEdit2->Text.c_str()));
  ShowMessage("日期格式设置成功!");
 }
 __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-YYYY");
CSpinEdit2->Items->Add("MM/DD/YYYY");
CSpinEdit2->Items->Add("MM-DD-YY");
CSpinEdit2->Items->Add("MM/DD/YY");
CSpinEdit2->Items->Add("DD-MM-YYYY");
CSpinEdit2->Items->Add("DD/MM/YYYY");
CSpinEdit2->Items->Add("DD-MM-YY");
CSpinEdit2->Items->Add("DD/MM/YY");
Label3->Caption="本程序是针对Oracle日期格式更改而设计的,/n设计环境:Windows98/Oracle7 /n适用于客户端和单机版用户。建立或修改注册表键值:";
}
//---------------------------------------------------------------------------

本文作者:胡广涛

电子邮箱/MSN: huguangtao0515@hotmail.com
QQ: 621150

 

0 0

相关博文

我的热门文章

img
取 消
img