Original Oracle Database Import and Export Tool

Source: Internet
Author: User

Because I have poor memory, I often cannot remember the commands. Note that it is not very bad, it is too bad, and it is also relatively lazy, so I want to write a little thing and release the labor force. so I had an idea to write a small tool for importing and exporting the database, so that it would be difficult to modify the file path, especially the file path, in cmd.

11. There was nothing to do at home. The time came. At first, I wanted to write it in script language. For example, I called vbs in batch processing, and vbs used ie for GUI. Later I found that the monotonous vbs script was acceptable, however, if you use batch processing to call vbs, ie will not be able to get started, and the effect is not very good. Simply write a small program (Java will not be too troublesome ), fortunately, I know more about Delphi, but since Delphi is relatively simple, although I have been in contact with C ++ for three years in college ), but I still don't think it's as simple as Delphi I have never learned. this is the gap. You can only use easy-to-use languages. if you still forget VB, there is no development environment on the machine. A few days ago, I just got a lite version of Delphi. In this year, even the development tools have played a simple green, so I have to feel cold...

It is estimated that my blog is engaged in Java and I am not interested in the source code, but I am still preparing to post it out to prevent the occasional need. Using ShellExecute can start java. If you are interested, you can check it out. if you are not interested in reading the source code, try this tool. If you come to Delphi, you should pass...

This is my first complete Delphi Program. Its Debut is commemorative.

(My csdn resources): http://download.csdn.net/source/657522

 

  1. Unit unit2;
  2. Interface
  3. Uses
  4. Windows, messages, sysutils, variants, classes, graphics, controls, forms,
  5. Dialogs, stdctrls, shellapi, customizedlg;
  6. Type
  7. Tform1 = Class (tform)
  8. Execbutton: tbutton;
  9. Usernameedit: tedit;
  10. Usernamelabel: tlabel;
  11. Impradio: tradiobutton;
  12. Expradio: tradiobutton;
  13. Databaseedit: tedit;
  14. Databaselabel: tlabel;
  15. Fromuserlabel: tlabel;
  16. Passwordlabel: tlabel;
  17. Passwordedit: tedit;
  18. Fromuseredit: tedit;
  19. Touserlabel: tlabel;
  20. Touseredit: tedit;
  21. Opendialog1: topendialog;
  22. Ext;lineedit: tedit;
  23. Button3: tbutton;
  24. Filelabel: tlabel;
  25. Extcmdlabel: tlabel;
  26. Fileedit: tedit;
  27. Cmdlineedit: tedit;
  28. Bloglabel: tlabel;
  29. Procedure execbuttonclick (Sender: tobject );
  30. Procedure button3click (Sender: tobject );
  31. Procedure bloglabelmouseenter (Sender: tobject );
  32. Procedure bloglabelmouseleave (Sender: tobject );
  33. Procedure bloglabelclick (Sender: tobject );
  34. Procedure databaseeditchange (Sender: tobject );
  35. Procedure chgw.line ();
  36. Procedure formcreate (Sender: tobject );
  37. Procedure impradioclick (Sender: tobject );
  38. Procedure expradioclick (Sender: tobject );
  39. Procedure usernameeditchange (Sender: tobject );
  40. Procedure passwordeditchange (Sender: tobject );
  41. Procedure fromusereditchange (Sender: tobject );
  42. Procedure tousereditchange (Sender: tobject );
  43. Procedure ext1_lineeditchange (Sender: tobject );
  44. Procedure fileeditchange (Sender: tobject );
  45. Procedure formdestroy (Sender: tobject );
  46. Private
  47. {Private Declarations}
  48. Public
  49. {Public declarations}
  50. End;
  51. VaR
  52. Form1: tform1;
  53. Batfile: textfile;
  54. Implementation
  55. {$ R *. DFM}
  56. Procedure tform1.execbuttonclick (Sender: tobject );
  57. Begin
  58. Assignfile (batfile, 'temp. bat ');
  59. Rewrite (batfile );
  60. Writeln (batfile, '% ~ 1 '+ #10 + 'pause ');
  61. Closefile (batfile );
  62. ShellExecute (application. Handle, 'open', 'temp. bat', pchar ('"' + response lineedit. Text + '"'), nil, sw_show );
  63. End;
  64. Procedure tform1.button3click (Sender: tobject );
  65. Begin
  66. Opendialog1.filter: = 'backup file | *. dmp | all files | *.*';
  67. If opendialog1.execute then
  68. Begin
  69. Fileedit. Text: = opendialog1.filename;
  70. End;
  71. End;
  72. Procedure tform1.bloglabelmouseenter (Sender: tobject );
  73. Begin
  74. Bloglabel. Font. Style: = [fsunderline];
  75. End;
  76. Procedure tform1.bloglabelmouseleave (Sender: tobject );
  77. Begin
  78. Bloglabel. Font. Style: = [];
  79. End;
  80. Procedure tform1.bloglabelclick (Sender: tobject );
  81. Begin
  82. ShellExecute (handle, 'open', 'HTTP: // blog.csdn.net/sunyujia/', '','', sw_shownormal );
  83. End;
  84. Procedure tform1.databaseeditchange (Sender: tobject );
  85. Begin
  86. Chgw.line ();
  87. Ext;lineedit. Text: = 'Log = '+ databaseedit. Text +'. log ';
  88. Fileedit. Text: = databaseedit. Text + '. dmp ';
  89. End;
  90. Procedure tform1.chgw.line ();
  91. Begin
  92. Export lineedit. Text: = usernameedit. Text + '/' + passwordedit. Text + '@' + databaseedit. text;
  93. If impradio. Checked = true then
  94. Begin
  95. Export lineedit. Text: = 'Imp '+ export lineedit. Text + 'fromuser =' + fromuseredit. Text + ''+ 'touser = '+ touseredit. Text + '';
  96. End else
  97. Begin
  98. Export lineedit. Text: = 'exp' + export lineedit. Text + 'owner = '+ fromuseredit. Text + '';
  99. End;
  100. Export lineedit. Text: = export lineedit. Text + 'file = "'+ fileedit. Text +'" '+ ext1_lineedit. text;
  101. End;
  102. Procedure tform1.usernameeditchange (Sender: tobject );
  103. Begin
  104. Chgw.line ();
  105. Fromuseredit. Text: = usernameedit. text;
  106. Touseredit. Text: = usernameedit. text;
  107. End;
  108. Procedure tform1.formdestroy (Sender: tobject );
  109. Begin
  110. Deletefile ('temp. bat ');
  111. End;
  112. Procedure tform1.formcreate (Sender: tobject );
  113. Begin
  114. Chgw.line ();
  115. End;
  116. Procedure tform1.impradioclick (Sender: tobject );
  117. Begin
  118. Chgw.line ();
  119. End;
  120. Procedure tform1.expradioclick (Sender: tobject );
  121. Begin
  122. Chgw.line ();
  123. End;
  124. Procedure tform1.passwordeditchange (Sender: tobject );
  125. Begin
  126. Chgw.line ();
  127. End;
  128. Procedure tform1.fromusereditchange (Sender: tobject );
  129. Begin
  130. Chgw.line ();
  131. End;
  132. Procedure tform1.tousereditchange (Sender: tobject );
  133. Begin
  134. Chgw.line ();
  135. End;
  136. Procedure tform1.ext1_lineeditchange (Sender: tobject );
  137. Begin
  138. Chgw.line ();
  139. End;
  140. Procedure tform1.fileeditchange (Sender: tobject );
  141. Begin
  142. Chgw.line ();
  143. End;
  144. End.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.