📄 unit3.cpp
字号:
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit3.h"
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm3 *Form3;
//---------------------------------------------------------------------------
__fastcall TForm3::TForm3(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm3::Button2Click(TObject *Sender)
{
Form3->Close();
Application->Terminate();
}
//---------------------------------------------------------------------------
void __fastcall TForm3::Button1Click(TObject *Sender)
{
if(Form3->Edit1->Text.IsEmpty())
{ShowMessage("服务器名不能为空");
return;
}
Form3->Close();
char dsname[300];
StrCopy(dsname,"Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=library;Data Source=");
StrCat(dsname,Form3->Edit1->Text.c_str());
StrCat(dsname,";Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=");
StrCat(dsname,Form3->Edit1->Text.c_str());
StrCat(dsname,";Use Encryption for Data=False;Tag with column collation when possible=False");
Form1->ADOConnection1->ConnectionString=dsname;
}
//---------------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -