o(╥﹏╥)oSad

WeChat cannot downloadMyCode code generator, but just click on the upper right corner and select open in browser or Safari!
MyCode code generator

MyCode code generator

  • Size: 0.54M
  • Language: Simplified Chinese
  • Category: Database class
  • System:winall

MyCode code generator automatically generates BCB version of database operation code (ADO) without manual writing. It only requires simple calls to perform tedious database operations.

MyCode code generator

call method

Preparation:

Log in to the database, click Generate, copy the DBComm folder to the application directory, and add the following to the cpp file header:

#include ".DBCommDBTablesMyInfoOperator.h"

#include ".DBCommDBTablesRecordOperator.h"

#include ".DBCommDBTablesRecordViewOperator.h"

#include ".DBCommDBComm.h"

Click the "Project" menu, select "Add to Project", and add all cpp files in DBComm (including cpp files under DBTables)

Call example

Connect to database

void __fastcall TForm1::FormCreate(TObject *Sender)

{

WideString wstrConnStr="Provider=SQlolEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=mytest";

if(DBComm::Instance().ConnectDB(wstrConnStr))

{

DBGrid1->DataSource=DBComm::Instance().Tables<RecordViewOperator>(DBComm::RecordView)->Source();

}

}

 

Add a new record

void __fastcall TForm1::SpeedButton1Click(TObject *Sender)

{

DBComm::Instance().Tables<MyInfoOperator>(DBComm::MyInfo)->New(LabeledEdit2->Text,LabeledEdit3->Text.ToDouble(),"admin",Now());

}

}

 

Delete a record

void __fastcall TForm1::SpeedButton3Click(TObject *Sender)

{

if(DBGrid1->DataSource->DataSet->RecordCount)

{

int nID=DBGrid1->DataSource->DataSet->Fields->Fields[0]->AsInteger;

String strCondition="ID="+String(nID);

DBComm::Instance().Tables<RecordOperator>(DBComm::Record)->Delete(strCondition);

}

}

 

Update a record

void __fastcall TForm1::SpeedButton2Click(TObject *Sender)

{

if(DBGrid1->DataSource->DataSet->RecordCount)

{

int nID=DBGrid1->DataSource->DataSet->Fields->Fields[1]->AsInteger;

String strName=LabeledEdit2->Text;

float fMoney=LabeledEdit3->Text.ToDouble();

String strCondition="ID="+String(nID);

DBComm::Instance().Tables<MyInfoOperator>(DBComm::MyInfo)->Update(strName,fMoney,"admin",Now(),strCondition);

}

}

 

Get data source

DBGrid1->DataSource=DBComm::Instance().Tables<RecordViewOperator>(DBComm::RecordView)->Source();

Version: v1.0 green version | Update time: 2024-12-30

Similar recommendations

Latest updates

MyCode Code Generator Review

  • 1st floor Huajun netizen 2020-01-04 10:37:52
    The overall feeling of MyCode code generator is good, I am quite satisfied, the installation and operation are very smooth! It went very smoothly following the installation step-by-step instructions!
  • 2nd floor Huajun netizen 2020-08-22 05:19:03
    MyCode code generator is convenient, practical and powerful. The software is very easy to use!
  • 3rd floor Huajun netizen 2020-10-02 23:47:15
    MyCode code generator has quite comprehensive functions. It is the latest version and is free to download. Keep up the good work!

Recommended products

everyonealso likeThese:

+

This application has not passed real-name authentication. You can download it through the mobile assistant.

CancelOK