<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-657334141637780777</id><updated>2011-11-28T08:23:14.530+07:00</updated><category term='asp'/><category term='PHP'/><category term='Firebird'/><category term='excel'/><category term='MySQL'/><category term='Database'/><category term='msaccess'/><category term='Delphi'/><title type='text'>Code Programmer</title><subtitle type='html'>Find things about programming code here such as delphi, firebird, mysql, microsoft excel, database, tips and tricks etc.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>30</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-6834858564085626590</id><published>2008-02-27T10:02:00.003+07:00</published><updated>2008-03-18T19:08:45.597+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><title type='text'>How to copy MySQL database from one computer / server on the other?</title><content type='html'>How to &lt;a style="font-weight: bold;" href="http://codeprogrammer.blogspot.com/2008/02/how-to-copy-mysql-database-from-one.html"&gt;copy MySQL database&lt;/a&gt; from one computer / server on the other?&lt;br /&gt;&lt;br /&gt;The short answer, you can &lt;span style="font-weight: bold;"&gt;copy the database&lt;/span&gt; from one computer / server to another using ssh or mysql client.&lt;br /&gt;&lt;br /&gt;You can run all above 3 teams in a single pass using&lt;span style="font-weight: bold;"&gt; mysqldump&lt;/span&gt; and mysql commands (unsafe way, use only if you use a VPN network or task):&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysqldump&lt;/span&gt; $ db-name | mysql-h remote.box.com DB-name&lt;br /&gt;&lt;br /&gt;Using ssh, if you do not have direct access to the remote server mysql (safest method):&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;mysqldump&lt;/span&gt; $ db-name | ssh user@remote.box.com mysql database name&lt;br /&gt;&lt;br /&gt;You can simply copy the table named foo in the remote database (mysql and remote server remote.box.com) called the bar through the same syntax:&lt;br /&gt;$ &lt;span style="font-weight: bold;"&gt;mysqldump&lt;/span&gt; DB-name foo | ssh user@remote.box.com mysql bar&lt;br /&gt;&lt;br /&gt;This will not only save time, but you can impress your friend too;). Almost all commands can be executed using pipes under UNIX / Linux oses.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;for easy way, create the batch file, for windows like the following:&lt;br /&gt;cd \ your_mysql_bin_folder&lt;br /&gt;mysqladmin-u root - password = create test_backup&lt;br /&gt;mysqldump u root - password = test | mysql-u root - password = test_back&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-6834858564085626590?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/6834858564085626590/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=6834858564085626590' title='46 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/6834858564085626590'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/6834858564085626590'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2008/02/how-to-copy-mysql-database-from-one.html' title='How to copy MySQL database from one computer / server on the other?'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>46</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-8516975169291343891</id><published>2008-01-07T16:32:00.001+07:00</published><updated>2008-03-18T19:10:19.523+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><title type='text'>Delphi PHP</title><content type='html'>I have already post about &lt;a href="http://codeprogrammer.blogspot.com/2008/01/delphi-php.html"&gt;&lt;span style="font-weight: bold;"&gt;php which is like delphi&lt;/span&gt;&lt;/a&gt;, I have made some changes, you can download it for free &lt;a href="http://ysuhendro.googlepages.com/DelphiPHP.rar"&gt;here .&lt;/a&gt;&lt;br /&gt;And please review to make it perfect.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-8516975169291343891?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/8516975169291343891/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=8516975169291343891' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/8516975169291343891'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/8516975169291343891'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2008/01/delphi-php.html' title='Delphi PHP'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-6221271664543565967</id><published>2007-12-17T16:38:00.001+07:00</published><updated>2007-12-17T16:38:36.555+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='excel'/><title type='text'>Excel Vacabulary</title><content type='html'>Thousands of line of VBA code in my Resource Workbooks&lt;br /&gt;&lt;br /&gt;Here is some vocabulary you might want to adopt so that others can understand you and so you can understand the programmers and discover that they are just ordinary people doing a different job.&lt;br /&gt;&lt;br /&gt;Procedure: A set of instruction that you want the computer to execute. In the old days when the computers were small and slow and the languages were not well developed, they were called macros&lt;br /&gt;&lt;br /&gt;Objects: They are the building blocks of your procedures (workbooks, worksheets, charts, drawings, controls (buttons, text boxes, list boxes, etc.)), VBA modules, procedures, etc.&lt;br /&gt;&lt;br /&gt;Properties: Think of the verb to be. Objects have properties that you can change.&lt;br /&gt;&lt;br /&gt;Methods: Think of the verb to do. You might want an object to close, to open, etc.&lt;br /&gt;&lt;br /&gt;Events: For a procedure to be executed, an event must happen. One event that everybody knows is the click of the button. Other events are the opening a workbook, the activating a sheet. So, you have to tell the computer when to execute a procedure.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;Sub Command125_Click ()&lt;br /&gt;Range("A2").Value= 2&lt;br /&gt;Application.Close&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;The "Sub" is the procedure; "Command125_Click" is the event; "Range ("A2")" and "Application" are objects; "Value" is a property" and "Close" is a method.&lt;br /&gt;&lt;br /&gt;This procedure says that when the user clicks on the command button 125, the cell A2 takes a value of 2 and Excel is closed.&lt;br /&gt;&lt;br /&gt;As you will discover in this Web site, you don't have to write much code, the Macro Recorder does the work for you.&lt;br /&gt;&lt;br /&gt;http://codeprogrammer.blogspot.com&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-6221271664543565967?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/6221271664543565967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=6221271664543565967' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/6221271664543565967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/6221271664543565967'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/12/excel-vacabulary.html' title='Excel Vacabulary'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-1984212618292070469</id><published>2007-12-17T16:37:00.001+07:00</published><updated>2007-12-17T16:37:50.836+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='excel'/><title type='text'>Excel Intruduction</title><content type='html'>Introduction&lt;br /&gt;&lt;br /&gt;VBA in Excel was first used to automate repetitive tasks, VBA served to order the computer to do tasks that the users usually did. Because VBA did that more rapidly and more efficiently than the best user, it was possible to develop applications to complete tasks that even a team of well trained users could not perform within the deadlines imposed by the decision making process. These orders were MACROS. Since 1997, VBA is a full fledge programming language that allows a developer to create applications (programs within Excel), the MACROS are now PROCEDURES.&lt;br /&gt;&lt;br /&gt;If you don't master thoroughly the functions and functionalities of Excel, you will never become a good VBA programmer, you will be re-inventing the wheel while cars will be flying.&lt;br /&gt;&lt;br /&gt;If you don't listen to the user who has the knowledge of the data, you will never be a good VBA programmer and if you don't listen to the client and don't try to understand her/his needs, you will never be a good VBA programer.&lt;br /&gt;&lt;br /&gt;Programing will never constitute more than 25% of the work, the other 75% consisting of understanding the needs of the client and designing the workbook within which the programming will be developed.&lt;br /&gt;&lt;br /&gt;So to begin with, I offer you some vocabulary of the trade and then, the tools I use in my daily work as a Consultant in Excel-VBA-Access.&lt;br /&gt;&lt;br /&gt;First, a section of General Rules for VBA and the Visual Basic Editor (VBE) to simplify the work of the developer and of the person who will have to maintain the applications or modify them in the absence of the original designer.&lt;br /&gt;&lt;br /&gt;Secondly, the most important section: Moving Around in Excel. This section shos you how to move between cell, between sheet, between workbooks. It shows you how to select cells and ranges.&lt;br /&gt;&lt;br /&gt;Then a section on VB itself VB-Statements and a section on functions of both VB and VBA VB-VBA-Functions. A section covers the controls and forms VBA-Controls and Forms and another one adresses the procedure's triggers, VBA-Events. Finally three pages on VBA-Objects, VBA-Properties and, VBA-Methods.&lt;br /&gt;&lt;br /&gt;Finally, join the major leagues, discover the VBA array variables. Start working in the virtual world.&lt;br /&gt;&lt;br /&gt;VBA Q&amp;A's&lt;br /&gt;&lt;br /&gt;What is VBA?&lt;br /&gt;&lt;br /&gt;VBA is "Visual Basic for application". It is a programming language that allows users to program complex tasks within an application. There is VBA for Excel, VBA for Word, VBA for Project, VBA for Access, etc.&lt;br /&gt;&lt;br /&gt;Where does VBA come from?&lt;br /&gt;&lt;br /&gt;In the ྂ a new computer language appeared, it was called Basic. I used it on advanced calculators and on my COCO64 from Radio-Shack. At the time, RAM (memory) and CPU's (the brain of the computer) being very very small, you were limited in what you could do with the language. With today's computer, came Visual Basic. It is still Basic, but a lot of elements are pre-programmed making the user's task much simpler. Microsoft adopted the language and introduced it as a component of all its applications thus the VBA that stands for Visual Basic for Application. So now you can program in Visual Basic (VB) to create applications or you can program within an application (Excel, Access, Word, Project, etc.) with Visual Basic for Application (VBA). This section of my Website is about VBA for Excel. I also maintain a Web site on VBA for Access.&lt;br /&gt;&lt;br /&gt;Should I learn VBA or VB?&lt;br /&gt;&lt;br /&gt;Let's say that VB is for programmers and VBA is for users (or developers). Personally, I took hundreds of hours of training in VB but I do all my work in VBA (Excel and Access). You don't need to learn VB to be good at VBA. I adopted VBA because most of the functions I need to organize and analyze data are pre-programmed in Excel and Access. It costs a lot less to develop financial and management applications in Excel and Access than to re-invent the wheel and do everything in VB.&lt;br /&gt;&lt;br /&gt;What is the difference between VB, VBA for Excel, VBA for Access, VBA for Word, VBA for Project, etc?&lt;br /&gt;&lt;br /&gt;To answer this question, I will ask you to imagine a meeting of five English speaking persons, a lawyer, an accountant, a physician, a chemist and a psychologist. They all speak English but when it is time to talk about their work, none of them totally understand the other. It is the same with each VBA, the objects, properties, methods and events vary from a language to the other.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;MACROS or Procedures&lt;br /&gt;&lt;br /&gt;You will notice that within my HelpSite on VBA-Excel, I use the term "procedure" rather than "Macro". I consider VBA-Excel as a Development Environment hence, the "procedure". I would hope that my colleagues Developers start using this word so that VBA-Excel earns a status among Developers and Users in the field of Database Interface, Datamarting, Datamining and Financial and Strategic Information Analysis Systems.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The tips offered below are:&lt;br /&gt;&lt;br /&gt;Indispensable&lt;br /&gt;Very useful&lt;br /&gt;Interesting&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;All through this web site, you will encounter the following icon:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Click on it and a demo will appear to illustrate the topic. The cursor moves, explanations are supplied in balloons, it happens in front of your very eyes, on line.&lt;br /&gt;&lt;br /&gt;And you can get all the viewlets for free, click here.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;General Rules and VBE&lt;br /&gt;&lt;br /&gt;Note: Your best VBA coach is the Macro Recorder (Tools/Macro/New Macro). Start it, do what you want your code to do and then go to the Visual Basic Editor (VBE) and cut and paste these segments of code. Personally, I use the Register a lot to avoid writing and spelling errors. I adapt the code that is offered by VBE.&lt;br /&gt;&lt;br /&gt;Note: Quotes within quotes must be doubled. Hence,&lt;br /&gt;Selection.Formula= "=Range ("A1").Value &amp; "normal"" must be written&lt;br /&gt;Selection.Formula = "=Range(""A1"").Value &amp; ""normal"""&lt;br /&gt;&lt;br /&gt;When I work with the Visual Basic Editor (VBE) I use three windows, the Project window, the properties window and the code window.&lt;br /&gt;&lt;br /&gt;You can test a procedure line by line by clicking within the procedure in the Code Window of the VBE and using the F8 key. After a line of code containing a variable has been executed, you can check the value of this variable by moving the cursor on top of the name of the variable.&lt;br /&gt;&lt;br /&gt;You can see your VBA code at work by opening both Excel and the Visual Basic Editor and then by right clicking on the task bar and splitting the screen.&lt;br /&gt;&lt;br /&gt;Declare all your variables (Dim) at the beginning of the procedure, it will simplify the testing of your code.&lt;br /&gt;&lt;br /&gt;To test part of a VBA procedure, start the execution with the F8 key. Then, click on the yellow arrow in the margin of the code window and drag it down to the line you want to test. Use the F8 key from there.&lt;br /&gt;&lt;br /&gt;To test part of a procedure, you can also press F8 then right click in the margin of the code window in front of the line that you want to test and select "Set next statement". From then on, you use F8.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;To create code within an event related to the sheet, right click on the sheet's tab and select "View Code". Then select the event from the event window and write your code.&lt;br /&gt;&lt;br /&gt;You can carry the value of a variable from one procedure to the other by stocking this value in any cell in the workbook. ex:&lt;br /&gt;in the first procedure:&lt;br /&gt;Range("A3456").Value=Variable1&lt;br /&gt;in the second procedure:&lt;br /&gt;Variable2=Range("A3456").Value&lt;br /&gt;&lt;br /&gt;Name ALL the cells and ranges that you use in your code so that if their address changes (adding or deleting columns or rows, changing the name of sheets, etc..), your code is not invalidated.&lt;br /&gt;Selection.Name = "nfaBalance"&lt;br /&gt;&lt;br /&gt;Note: If you want to name the fields that you use in array formulas, Index/Match formulas and VBA procedures in Excel, you select the pertinent cell or field and then you go to the Name Zone and type a name. Then, CLICK ENTER. Use prefixes (nf, general named fields; prf, fields used in procedures; aff, array formula fields; etc..)&lt;br /&gt;&lt;br /&gt;Write your code in lower case letters. If the spelling is right, VBE will capitalize the necessary letters. If it doesn't, check your spelling.&lt;br /&gt;&lt;br /&gt;Always activate the "Option Explicit". You are forced to declare variables but there are many advantages. If you have the wrong spelling for your variable, VBE will tell you. You are always sure that your variables are considered by VBE. You can use Shift/Space to call your variables in a contextual menu and double click them rather then key them in.&lt;br /&gt;&lt;br /&gt;http://codeprogrammer.blogspot.com&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-1984212618292070469?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/1984212618292070469/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=1984212618292070469' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/1984212618292070469'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/1984212618292070469'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/12/excel-intruduction.html' title='Excel Intruduction'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-6824275404223550493</id><published>2007-12-17T16:30:00.001+07:00</published><updated>2008-03-18T19:16:41.784+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='excel'/><title type='text'>Excel As Database</title><content type='html'>&lt;a style="font-weight: bold;" href="http://codeprogrammer.blogspot.com/2007/12/excel-as-database.html"&gt;Excel As Database&lt;/a&gt; ?&lt;br /&gt;On this page, I present the limits of &lt;span style="font-weight: bold;"&gt;Excel as a database&lt;/span&gt; and it's functionalities in that field. There are sections on general tips, on filters, and on formulas.&lt;br /&gt;&lt;br /&gt;I also illustrate an &lt;span style="font-weight: bold;"&gt;Data Management System&lt;/span&gt; that includes Excel and that can be a excellent solution if you have less than 60,0000 employees, less than 60,000 sales per year, less than 60,000 employees, less than 60,000 items for sale and less than 60,000 accounts in your accounting system. From this database, you can design an accounting system, an inventory system, a billing system, etc. You will be able to maintain such a system internally and adapt it to the changes in your organization.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Excel is not a database application&lt;/span&gt; but it is &lt;span style="font-weight: bold;"&gt;the best reporting tool on the market&lt;/span&gt;. You can import data from any database or datamart and create reports and analysis to satisfy your needs for a small fraction of the cost that you would incur if you would use the reporting applications of the database. You will save a lot of time and be able to train many users becoming less dependant on the limited resources of your IS department.&lt;br /&gt;If you want to develop a database or a datamart in Access,&lt;br /&gt;visit my page on the subject.&lt;br /&gt;Even if many users can open the same workbook at the same time (in read only mode), the limit of &lt;span style="font-weight: bold;"&gt;Excel as a database &lt;/span&gt;resides in the fact that only one user can enter data in a workbook at one time. If two to 15 users must enter data simultaneously, you may want to move to Access as a database. If more than 20 users must enter data simultaneously, you will choose one of the big databases (SQL Server, Sybase, Oracle, dB, etc).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;An &lt;span style="font-weight: bold;"&gt;Excel workbook&lt;/span&gt; may comprise 256 sheets with 256 columns and 65,000 rows each which amount to 4,294,967,296 cells. Each cell can hold 32,767 characters each or a formula 1,024 characters long. With a 500 mhz CPU and 128 Mg of RAM, &lt;span style="font-weight: bold;"&gt;Excel can be used as a database&lt;/span&gt;. &lt;span style="font-weight: bold;"&gt;The great power of Excel&lt;/span&gt; is its conviviality to design reports, analysis and charts.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Fundamental DATABASE Notion&lt;br /&gt;&lt;br /&gt;A DATABASE is a set of data&lt;br /&gt;which reading is convivial&lt;br /&gt;for a MACHINE.&lt;br /&gt;&lt;br /&gt;A REPORT (or form) is a set of data&lt;br /&gt;which reading is convivial&lt;br /&gt;for a HUMAN.&lt;br /&gt;&lt;br /&gt;Very rarely will you be able to organize data so that reading them is convivial to both machines and humans.&lt;br /&gt;&lt;br /&gt;To become an expert in database a good background in computer science is essential. To become an expert in reporting you need a good background in accounting and management.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Excel Database&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Note: Select a different format for the title cells as oppose to the other cells of the table so that Excel understands that it is working with a database and not just a table with no title cells. Excel will consider your table as a Database if in the first cell of each column the font is bold and the inferior border is also bold. Once these conditions are met, all items of the "Data" sub-menu become accessible (Filters, Sort, Form, Sub-Total, etc...).&lt;br /&gt;&lt;br /&gt;You know how to use the AUTOFILTER, you place the cursor within the database and go to the menu "Data/Filter/AutoFilter" and little arrows appear in the title cell of every field. If you want these dropdown menus to appear only for certain fields, select the desired column or columns before you go to the menu bar to use "Data/Filter/AutoFilter". (Thanks Darrel Steen)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Advanced Filters&lt;br /&gt;&lt;br /&gt;Advanced filters are one of the most important tool to be used with databases. Here are a few tips on these filters. Let's say we have a database with the following fields:&lt;br /&gt;&lt;br /&gt;First Name&lt;br /&gt;Name&lt;br /&gt;Age&lt;br /&gt;City&lt;br /&gt;Sex&lt;br /&gt;Weight&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The criteria range to filter members by the name of Thomas would be:&lt;br /&gt;Name&lt;br /&gt;&lt;br /&gt;Thomas&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The criteria range to filter the women of Montreal would be:&lt;br /&gt;Sex&lt;br /&gt;City&lt;br /&gt;&lt;br /&gt;W&lt;br /&gt;Montreal&lt;br /&gt;&lt;br /&gt;The criteria range to filter the women of Montreal and of Toronto would be:&lt;br /&gt;Sex&lt;br /&gt;City&lt;br /&gt;&lt;br /&gt;W&lt;br /&gt;Montreal&lt;br /&gt;&lt;br /&gt;W&lt;br /&gt;Toronto&lt;br /&gt;&lt;br /&gt;The criteria range to filter men between ages of 50 and 59 would be:&lt;br /&gt;Sex&lt;br /&gt;Age&lt;br /&gt;Age&lt;br /&gt;&lt;br /&gt;M&lt;br /&gt;&gt;=50&lt;br /&gt;&lt;60&gt;=50&lt;br /&gt;&lt;60&lt;br /&gt;&lt;br /&gt;W&lt;br /&gt;&lt;br /&gt;Other Formulas Useful with Excel as a Database&lt;br /&gt;&lt;br /&gt;SUBTOTAL&lt;br /&gt;The function SUBTOTAL allows (among other operations) to count, to sum or to calculate the average of non-filtered elements of a database. The function requires two arguments, the first is a number between "1" and "11" that specifies the operation to be performed (for ex. "1" is for average, "2" is for count and "9" is for sum) and, the second is the range covered by the function.&lt;br /&gt;=SUBTOTAL(9,B2:B45)&lt;br /&gt;This formula will sum the values in range (B2:B45) for records that are not filtered when a filter is applied on the database.&lt;br /&gt;&lt;br /&gt;A Data Management System with Excel and Access&lt;br /&gt;&lt;br /&gt;I have designed this system for a division of the Ministry of Supplies and Services (Government of Canada).&lt;br /&gt;&lt;br /&gt;In this system, I don't use Microsoft Query and the data are LIVE. Many users can view the different reports at the same time (invoice, contract, statistics, report1) but only one user can enter data at one time.&lt;br /&gt;&lt;br /&gt;The workbooks with a single sheet contain the data. They are the tables of this Data Management System. They can host as much as 60,000 records each (lines of data).&lt;br /&gt;&lt;br /&gt;The different reports (unlimited numbers) are linked to the "tables" with array formulas and Index/Match formulas. When a report is opened, a dialog window allows the user to refresh the data. On of the great advantage of Excel Reports is that they can be printed and, unlike other reports designed within database, they can be viewed on line. These reports are invoices, contracts, analysis, summary and detailed tables and charts.&lt;br /&gt;&lt;br /&gt;There is no convivial or ergonomic form to enter data in "Tables" in Excel. Even the automatic "Form" in Excel is rather limited. So I have created an Access application so that I could design convivial and ergonomic forms to enter the data in the "tables". The Excel workbooks with a single sheet are connected to the Access application through the "Link Tables" function.&lt;br /&gt;&lt;br /&gt;This Data Management System is easy and inexpensive to build, easy to maintain and very very friendly. Training on Access is minimal and Excel is a development environment within which your users are probably already familiar. You might want to hire a Data Analyst to make sure that the Excel workbooks with a single worksheet (your tables) are well designed as far as what they contain and how the information is organized.&lt;br /&gt;&lt;br /&gt;&lt;a style="font-weight: bold;" href="http://codeprogrammer.blogspot.com/2007/12/excel-as-database.html"&gt;Excel As Database&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-6824275404223550493?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/6824275404223550493/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=6824275404223550493' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/6824275404223550493'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/6824275404223550493'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/12/excel-as-database.html' title='Excel As Database'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-3665300252359682421</id><published>2007-12-17T15:53:00.000+07:00</published><updated>2007-12-17T15:54:44.284+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp'/><title type='text'>Create Your Own Hit Counter</title><content type='html'>&lt;%&lt;br /&gt;Application.Lock&lt;br /&gt;Application("Count") = Application("Count") + 1&lt;br /&gt;Application.Unlock&lt;br /&gt;x=application("Count")&lt;br /&gt;%&gt;&lt;br /&gt;&lt;font size="6"&gt;&lt;br /&gt;&lt;/font&gt;&lt;font size="10"&gt; &lt;font face="Arial"&gt;&lt;%=x%&gt;&lt;/font&gt;&lt;/font&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-3665300252359682421?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/3665300252359682421/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=3665300252359682421' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/3665300252359682421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/3665300252359682421'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/12/create-your-own-hit-counter.html' title='Create Your Own Hit Counter'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-4126040875602487606</id><published>2007-12-17T15:39:00.000+07:00</published><updated>2007-12-17T15:44:29.259+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp'/><title type='text'>Search Engine Script</title><content type='html'>&lt;p&gt;&lt;font face="Verdana,Geneva,Arial" size="2"&gt;&amp;lt;html&amp;gt;&lt;br&gt;&lt;br /&gt;&amp;lt;title&amp;gt;CodeAve.com(JavaScript: Search Many Sites)&amp;lt;/title&amp;gt;&lt;br&gt;&lt;br /&gt;&amp;lt;body bgcolor=&amp;quot;#FFFFFF&amp;quot;&amp;gt;&lt;br&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&amp;lt;script language=&amp;quot;JavaScript&amp;quot;&amp;gt;&lt;br&gt;&lt;br /&gt;&amp;lt;!--&lt;br&gt;&lt;br /&gt;function search_site()&lt;br&gt;&lt;br /&gt;{&lt;br&gt;&lt;br /&gt;// Build the destination url by placing the selection option first&lt;br&gt;&lt;br /&gt;var url = &lt;br /&gt;document.search_form.site.options[document.search_form.site.selectedIndex].value&lt;br /&gt;&lt;br&gt;&lt;br /&gt;// Append the text box input to the search url for the selected site&lt;br&gt;&lt;br /&gt;url = url + document.search_form.u_search.value;&lt;br&gt;&lt;br /&gt;// Change the the browser location to the new url&lt;br&gt;&lt;br /&gt;window.location.href = url;&lt;br&gt;&lt;br /&gt;}&lt;br&gt;&lt;br /&gt;--&amp;gt;&lt;br&gt;&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;br&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&amp;lt;center&amp;gt;&lt;br&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&amp;lt;form name=&amp;quot;search_form&amp;quot;&amp;gt;&lt;br&gt;&lt;br /&gt;&amp;lt;input tpye=&amp;quot;text&amp;quot; name=&amp;quot;u_search&amp;quot;&amp;gt;&lt;br&gt;&lt;br /&gt;&amp;lt;select name=&amp;quot;site&amp;quot; size=&amp;quot;1&amp;quot;&amp;gt;&lt;br&gt;&lt;br /&gt;&amp;lt;option value=&amp;quot;http://search.yahoo.com/bin/search?p=&amp;quot;&amp;gt;Yahoo&amp;lt;/option&amp;gt;&lt;br&gt;&lt;br /&gt;&amp;lt;option value=&amp;quot;http://www.go.com/Titles?qt=&amp;quot;&amp;gt;Go.com&amp;lt;/option&amp;gt;&lt;br&gt;&lt;br /&gt;&amp;lt;option value=&amp;quot;http://www.goto.com/d/search/?Keywords=&amp;quot;&amp;gt;GoTo.com&amp;lt;/option&amp;gt;&lt;br&gt;&lt;br /&gt;&amp;lt;option value=&amp;quot;http://search.excite.com/search.gw?search=&amp;quot;&amp;gt;Excite&amp;lt;/option&amp;gt;&lt;br&gt;&lt;br /&gt;&amp;lt;option value=&amp;quot;http://www.lycos.com/srch/?query=&amp;quot;&amp;gt;Lycos&amp;lt;/option&amp;gt;&lt;br&gt;&lt;br /&gt;&amp;lt;option value=&amp;quot;http://hotbot.lycos.com/?MT=&amp;quot;&amp;gt;HotBot&amp;lt;/option&amp;gt;&lt;br&gt;&lt;br /&gt;&amp;lt;option value=&amp;quot;http://www.altavista.com/cgi-bin/query?&amp;amp;q=&amp;quot;&amp;gt;Alta Vista&amp;lt;/option&amp;gt;&lt;br&gt;&lt;br /&gt;&amp;lt;option value=&amp;quot;http://www.webcrawler.com/cgi-bin/WebQuery?searchText=&amp;quot;&amp;gt;WebCrawler&amp;lt;/option&amp;gt;&lt;br&gt;&lt;br /&gt;&amp;lt;option value=&amp;quot;http://www.mamma.com/Mamma?&amp;amp;query=&amp;quot;&amp;gt;Mamma.com&amp;lt;/option&amp;gt;&lt;br&gt;&lt;br /&gt;&amp;lt;option value=&amp;quot;http://search.aol.com/dirsearch.adp?query=&amp;quot;&amp;gt;AOL.com&amp;lt;/option&amp;gt;&lt;br&gt;&lt;br /&gt;&amp;lt;option value=&amp;quot;http://search.msn.com/results.asp?q=&amp;quot;&amp;gt;MSN.com&amp;lt;/option&amp;gt;&lt;br&gt;&lt;br /&gt;&amp;lt;/select&amp;gt;&lt;br&gt;&lt;br /&gt;&amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Search&amp;quot; onClick=&amp;quot;JavaScript:search_site()&amp;quot;&amp;gt;&lt;br&gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br&gt;&lt;br /&gt;&lt;br&gt;&lt;br /&gt;&amp;lt;/center&amp;gt;&lt;br&gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br&gt;&lt;br /&gt;&amp;lt;/html&amp;gt; &lt;br&gt;&lt;br /&gt;&amp;nbsp;&lt;/font&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;http://codeprogrammer.blogspot.com&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-4126040875602487606?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/4126040875602487606/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=4126040875602487606' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/4126040875602487606'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/4126040875602487606'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/12/search-engine-script.html' title='Search Engine Script'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-7761084819955653313</id><published>2007-12-17T15:28:00.000+07:00</published><updated>2007-12-17T15:30:40.033+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='asp'/><title type='text'>Formatting Numbers : Currency</title><content type='html'>&lt;span style="font-family:Verdana,Geneva,Arial;font-size:85%;"&gt;&lt;b&gt;&lt;/b&gt;The function you need to format currency is FormatCurrency. It is very easy to use and has been outlined and explained below:&lt;br /&gt;&lt;br /&gt;FormatCurrency(NumToBeFormatted[, NumOfDigitsAfterDecimal, IncludeLeadingDigit, UseParensForNegativeNumbers])&lt;br /&gt;- returns a formatted currency from the number specified with the appropriate number of digits specified after the decimal&lt;br /&gt;- the first parameter is the only one that is required, although I recommend that you use at least include the second parameter.&lt;br /&gt;- the last two parentheses are tristate values which means you need to specify a -1 for true, 0 for false, or -2 to use the computers regional settings.&lt;br /&gt;- the IncludeLeadingDigit parameter is used to specify whether or not you want a leading zero to be displayed when the number is a fractional value.&lt;br /&gt;- the UseParensForNegativeNumbers parameter is pretty self explanatory, if set to true it will put parentheses around negative numbers.&lt;br /&gt;- this function also adds a '$' sign at the beginning of the output for you.&lt;br /&gt;&lt;br /&gt;Example:&lt;br /&gt;&lt;br /&gt;var1 = 5443.354&lt;br /&gt;var2 = -877743.2345&lt;br /&gt;Response.Write("var1 formatted = " &amp;amp; FormatCurrency(var1, 2, -1, -1) &amp;amp; "&lt;br /&gt;")&lt;br /&gt;Response.Write("var2 formatted = " &amp;amp; FormatCurrency(var2, 1, -1, -1))&lt;br /&gt;&lt;br /&gt;Result:&lt;br /&gt;&lt;br /&gt;var1 formatted = $5,443.35&lt;br /&gt;var2 formatted = ($877,743.2)&lt;br /&gt;&lt;br /&gt;http://yudhisuhendro.blogspot.com&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-7761084819955653313?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/7761084819955653313/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=7761084819955653313' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/7761084819955653313'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/7761084819955653313'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/12/formatting-numbers-currency.html' title='Formatting Numbers : Currency'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-7284340131074707155</id><published>2007-12-17T13:59:00.000+07:00</published><updated>2007-12-17T14:00:25.304+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='msaccess'/><title type='text'>Date and Time Functions and Formulas</title><content type='html'>&lt;p style="margin-left: 6px;"&gt;       &lt;span style="font-family:Verdana,Geneva,Arial;font-size:85%;"&gt;       &lt;span style="font-family:Verdana,Geneva,Arial;font-size:78%;"&gt;&lt;/span&gt;Note: When your are working on formulas in the control's property dialog window or in query pertinent fields, right click and choose "Zoom", a special enlarged window will open to facilitate your work.&lt;br /&gt;&lt;br /&gt;Note: Click on the Wizard's stick to open the Expression Generator. In the left bottom window of the dialog box, you can click on "Functions" to select any of the functions offered by Access.&lt;br /&gt;&lt;br /&gt;==========&lt;br /&gt;Here are the functions that I use and some examples:&lt;br /&gt;&lt;br /&gt;Date, Between, And, Or, Day, Month, Year, Now, WeekDay, SerialDate, Left, Right, &amp;amp;, +, -, /, *, Len, IIF, Nz, Sum&lt;br /&gt;&lt;br /&gt;Nz&lt;br /&gt;The Nz function allows you to make calculations even if some of the controls are empty, or have a "Null" value". If you don't use this functions, you cannot sum a series of text boxes if even one as a Null value.&lt;br /&gt;=NZ(text1,0)+NZ(text2,0)....&lt;br /&gt;&lt;br /&gt;Using a format like "Fixed 2 decimals" in a text box, doesn't round up the result of a calculation to 2 decimals, it just shows the result with 2 decimals but calculates with all the decimals. Use the "Round" function even with "+" and "-", it rounds up your result to the number of decimals defined in the format. For some unknown reasons, I ended up with 0.999952 as the result of "1.3-0.3"&lt;br /&gt;=round([textBox1]/textBox2&lt;br /&gt;&lt;br /&gt;===================&lt;br /&gt;Date and Time Functions and Formulas&lt;br /&gt;&lt;br /&gt;Today&lt;br /&gt;Date()&lt;br /&gt;&lt;br /&gt;Yesterday&lt;br /&gt;Date()-1&lt;br /&gt;&lt;br /&gt;Do not use Now() because it includes date and time&lt;br /&gt;&lt;br /&gt;Last 7 days (do not confuse with last week)&lt;br /&gt;Between Date()-1 and Date()-7&lt;br /&gt;&lt;br /&gt;Current week&lt;br /&gt;Between Date()-(WeekDay(Date())-1) AND Date()+(7-WeekDay(Date()))&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Last week&lt;br /&gt;Between Date()-6-WeekDay(Date()) AND Date()-WeekDay(Date())&lt;br /&gt;&lt;br /&gt;Week before last week&lt;br /&gt;Between Date()-13-WeekDay(Date()) AND Date()-WeekDay(Date())-7&lt;br /&gt;&lt;br /&gt;Current month:&lt;br /&gt;Month([yourDateField])=Month(Now())&lt;br /&gt;&lt;br /&gt;Current year:&lt;br /&gt;Year([yourDateField])=Year(Now())&lt;br /&gt;&lt;br /&gt;Last year (do not confuse with year ending today):&lt;br /&gt;Year([yourDateField])=Year(Now())-1&lt;br /&gt;&lt;br /&gt;Year ending today:&lt;br /&gt;Between Date() And Date()-365&lt;br /&gt;or more precisely:&lt;br /&gt;Between Date() and SerialDate(Year(Now())-1;Month(Now());Day(Now()))+1&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style="margin-left: 6px;"&gt;http://codeprogramer.blogspot.com&lt;br /&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-7284340131074707155?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/7284340131074707155/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=7284340131074707155' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/7284340131074707155'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/7284340131074707155'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/12/date-and-time-functions-and-formulas.html' title='Date and Time Functions and Formulas'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-5781394528892199665</id><published>2007-12-17T13:58:00.001+07:00</published><updated>2007-12-17T13:58:54.168+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='msaccess'/><title type='text'>Table Tips</title><content type='html'>&lt;span style="font-family:Verdana,Geneva,Arial;font-size:85%;"&gt;Do not use lists in the fields of the tables, you will be stuck with them along the way. Create List Boxes or Combo Boxes in forms and reports when you need them.&lt;br /&gt;&lt;br /&gt;A double Primary Key means that you can have two records "Leclerc" but not two records "Pierre"/"Leclerc". Remember though that to be able to enter data through a query linked to such a table, both fields will have to be included in the query.&lt;br /&gt;&lt;br /&gt;A numerical field is a field comprising numbers on which you will want to do mathematical operations. So, a telephone number, a postal code or an invoice number are text fields.&lt;br /&gt;&lt;br /&gt;You can put numbers in both numerical and text fields of an Access table but the sorting results will be different:&lt;br /&gt;In numerical fields: 1 ,2 ,3 ,4 ,5 ,6.......10.....20....30&lt;br /&gt;In text fields: 1, 10, 11, 12....,2, 20, 21....3, 30, 31&lt;br /&gt;&lt;br /&gt;Linking tables can present some limits. If you have a query within another query and both need to look at a linked table at the same time, ODBC cannot handle it. Sometimes, imported table are the solution especially in a datamart that is not used to enter data in the main database but to generate reports.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-5781394528892199665?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/5781394528892199665/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=5781394528892199665' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/5781394528892199665'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/5781394528892199665'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/12/table-tips.html' title='Table Tips'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-7441246445512807898</id><published>2007-12-17T13:57:00.001+07:00</published><updated>2007-12-17T13:57:45.604+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='msaccess'/><title type='text'>Query Tips</title><content type='html'>&lt;span style="font-family:Verdana,Geneva,Arial;font-size:85%;"&gt;       The query is where users and developers meet, it is the most vital part of the database.&lt;br /&gt;&lt;br /&gt;Once the data have been queried, they can be organized and analyzed by the user on forms and reports to achieve the ultimate goal of a database: to inform.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Notes&lt;br /&gt;&lt;br /&gt;If your query or your table feeds a form, there is no need to filter and sort whithin the query. You can manage these aspects in the "Filter/Sort" query of the form that you can access opening the form and going to the menu bar "Record/Filter/Advanced Filter/Sort". So, a query or a table can feed many forms.&lt;br /&gt;&lt;br /&gt;There is no "If" in Access, there is "Iif". So, in the criteria zone or in expressions, use "Iif" instead of "If". This rule doesn't apply in VBA coding except when you are setting an object formula through coding.&lt;br /&gt;&lt;br /&gt;For each report or form that you develop, always create a query. You never know when you will need a field from another table in your report or your from.&lt;br /&gt;&lt;br /&gt;When your Information Management System includes reports in Excel, create a query in Access and use Microsoft Query only to get the results of the query created in Access. Access is superior to Microsoft Query to create queries.&lt;br /&gt;&lt;br /&gt;Right click in the criteria or the field box and select "Zoom" when you are working with long criteria or formulas in calculated fields.&lt;br /&gt;&lt;br /&gt;To replace a word in a long formula, double-click on it and enter the new value. It is much simpler than clicking at the beginning of the word and dragging the pointer over the word.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-7441246445512807898?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/7441246445512807898/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=7441246445512807898' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/7441246445512807898'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/7441246445512807898'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/12/query-tips.html' title='Query Tips'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-990045585306867499</id><published>2007-11-29T10:47:00.001+07:00</published><updated>2007-11-29T10:47:17.443+07:00</updated><title type='text'>Text File To Web Page Automatically</title><content type='html'>Transform plain text files into Web pages automatically with this PHP script&lt;br&gt;By Contributor Melonfire, TechRepublic | 2007/01/08 11:26:02&lt;p&gt;Print this | E-mail this | Leave a comment | digg this | del.ici.ous&lt;p&gt;Change the text size: a | A&lt;p&gt;Recently, an old friend of mine rang me up to ask for help. He&amp;#39;d been working as a journalist for many years, and had recently received reprint rights to a number of his earlier columns.&lt;p&gt;He was eager to publish his past work on the Web; however, his columns were all saved as plain-text files and he had neither the time nor the inclination to learn HTML and convert them to Web pages. Since I was the only geek in his phone book, he&amp;#39;d called me to see if I could help him.&lt;p&gt;&amp;quot;Let me take care of it&amp;quot;, I said. &amp;quot;Call me back in an hour&amp;quot;, I said. And sure enough, when he called back a couple of hours later, I had a solution waiting for him. It involved a little bit of PHP, and it earned me his eternal thanks and a crate of wine.&lt;p&gt;So what did I do in that hour? That&amp;#39;s where this article comes in. I&amp;#39;m going to show you how you can use PHP to quickly transform plain ASCII text into perfectly readable HTML markup.&lt;p&gt;To begin, let&amp;#39;s look at an example of one of the raw text files my friend wanted to convert:&lt;p&gt;Green for Mars!&lt;br&gt;John R. Doe&lt;p&gt;The idea of little green men from Mars, long a staple of science fiction, may soon &lt;br&gt;turn out to be less fantasy and more fact.&lt;p&gt;Recent samples sent by the latest Mars exploration team indicate a high presence &lt;br&gt;of chlorophyll in the atmosphere. Chlorophyll, you will recall, is what makes &lt;br&gt;plants green. It&amp;#39;s quite likely, therefore, that organisms on Mars will have, &lt;br&gt;through continued exposure to the green stuff, developed a greenish tinge on their &lt;br&gt;outer exoskeleton. &lt;p&gt;An interview with Dr. Rushel Bunter, the head of ASDA&amp;#39;s Mars Colonization Project &lt;br&gt;blah blah...&lt;p&gt;What does this mean for you? Well, it means blah blahblah...&lt;p&gt;Track follow-ups to this story online at &lt;a href="http://www.mars-connect.dom/"&gt;http://www.mars-connect.dom/&lt;/a&gt;.&lt;p&gt;To see pictures of the latest samples, log on to &lt;a href="http://www.asdamcp.dom/galleries/220/"&gt;http://www.asdamcp.dom/galleries/220/&lt;/a&gt;&lt;p&gt;Fairly standard text: it has a title (or &amp;quot;slug&amp;quot;), a byline, and many paragraphs of text. All that&amp;#39;s really needed to transform this document into HTML is to use HTML line and paragraph break markers to preserve the original layout on a Web page. Special punctuation characters need to be converted into their HTML equivalents, and hyperlinks need to be made clickable.&lt;p&gt;Here&amp;#39;s the PHP code (Listing A) to accomplish all of the above:&lt;p&gt;&amp;lt;?php&lt;br&gt;// set source file name and path&lt;br&gt;$source = &amp;quot;toi200686.txt&amp;quot;;&lt;p&gt;// read raw text as array&lt;br&gt;$raw = file($source) or die(&amp;quot;Cannot read file&amp;quot;);&lt;p&gt;// retrieve first and second lines (title and author)&lt;br&gt;$slug = array_shift($raw);&lt;br&gt;$byline = array_shift($raw);&lt;p&gt;// join remaining data into string&lt;br&gt;$data = join(&amp;#39;&amp;#39;, $raw);&lt;p&gt;// replace special characters with HTML entities&lt;br&gt;// replace line breaks with &amp;lt;br /&amp;gt;&lt;br&gt;$html = nl2br(htmlspecialchars($data));&lt;p&gt;// replace multiple spaces with single spaces&lt;br&gt;$html = preg_replace(&amp;#39;/\s\s+/&amp;#39;, &amp;#39; &amp;#39;, $html);&lt;p&gt;// replace URLs with &amp;lt;a href...&amp;gt; elements&lt;br&gt;$html = preg_replace(&amp;#39;/\s(\w+:\/\/)(\S+)/&amp;#39;, &amp;#39; &amp;lt;a href=&amp;quot;\\1\\2&amp;quot; target=&amp;quot;_blank&amp;quot;&amp;gt;\\1\\2&amp;lt;/a&amp;gt;&amp;#39;, $html);&lt;p&gt;// start building output page&lt;br&gt;// add page header&lt;br&gt;$output =&amp;lt;&amp;lt;&amp;lt; HEADER&lt;br&gt;&amp;lt;html&amp;gt;&lt;br&gt;&amp;lt;head&amp;gt;&lt;br&gt;&amp;lt;style&amp;gt;&lt;br&gt;.slug {font-size: 15pt; font-weight: bold}&lt;br&gt;.byline { font-style: italic }&lt;br&gt;&amp;lt;/style&amp;gt;&lt;br&gt;&amp;lt;/head&amp;gt;&lt;br&gt;&amp;lt;body&amp;gt;&lt;br&gt;HEADER;&lt;p&gt;// add page content&lt;br&gt;$output .= &amp;quot;&amp;lt;div class=&amp;#39;slug&amp;#39;&amp;gt;$slug&amp;lt;/div&amp;gt;&amp;quot;;&lt;br&gt;$output .= &amp;quot;&amp;lt;div class=&amp;#39;byline&amp;#39;&amp;gt;By $byline&amp;lt;/div&amp;gt;&amp;lt;p /&amp;gt;&amp;quot;;&lt;br&gt;$output .= &amp;quot;&amp;lt;div&amp;gt;$html&amp;lt;/div&amp;gt;&amp;quot;;&lt;p&gt;// add page footer&lt;br&gt;$output .=&amp;lt;&amp;lt;&amp;lt; FOOTER&lt;br&gt;&amp;lt;/body&amp;gt;&lt;br&gt;&amp;lt;/html&amp;gt;&lt;br&gt;FOOTER;&lt;p&gt;// display in browser&lt;br&gt;echo $output;&lt;p&gt;// AND/OR &lt;p&gt;// write output to a new .html file&lt;br&gt;file_put_contents(basename($source, substr($source, strpos($source, &amp;#39;.&amp;#39;))) . &amp;quot;.html&amp;quot;, $output) or die(&amp;quot;Cannot write file&amp;quot;);&lt;br&gt;?&amp;gt;&lt;p&gt;Let&amp;#39;s see how this works:&lt;p&gt;   1. The first step is to read the raw ASCII file into a PHP array. This is easily accomplished with the file() function, which turns every line of the file into an element of a numerically-indexed array.&lt;br&gt;   2. Next, the title and author lines (I assume these are the first two lines of the file) are extracted from the array into separate variables using the array_shift() function. The remaining members of the array are then concatenated into a single string. This string will now contain the entire body of the article.&lt;br&gt;   3. Special characters like &amp;#39;, &amp;lt; and &amp;gt; within the body are converted into their HTML equivalents using the htmlspecialchars() function. To preserve the original formatting of the article, line and paragraph breaks are converted into HTML&lt;br&gt;      elements with the nl2br() function. Multiple spaces within the article body are compressed into a single space using simple string replacement.&lt;br&gt;   4. URLs within the body are detected using regular expressions, and are surrounded by elements. This turns the URLs into clickable hyperlinks when the page is viewed in a Web browser.&lt;br&gt;   5. The output HTML page is then constructed using standard HTML rules. The article title, author and body are formatted using CSS style rules. Although this script doesn&amp;#39;t do it, this is the point at which you would customize the appearance of the final page, perhaps by adding graphical elements, colors or other whiz-bangs to the template.&lt;br&gt;   6. Once the HTML page has been constructed, it can be sent to the browser or saved to a static file with file_put_contents(). Note that when saving, the original file name is decomposed and a new file (named filename.html) is created for the newly-minted Web page. You can then publish this Web page to a Web server, save it to a CD-ROM or edit it further.&lt;p&gt;Note: When using this script to create and save HTML files to disk, ensure that the script has write privileges on the directory to which the files are being saved.&lt;p&gt;As you can see, assuming you have ASCII plain-text data files in a standard format, you can convert them fairly quickly into usable Web pages with PHP. And if you have an existing Web site into which you plan to inject your new Web pages, it&amp;#39;s also quite easy to tweak the template used by the page generator to match the look and feel of your existing Web site. So go on, try it out for yourself!&lt;p&gt;&lt;a href="http://www.builderau.com.au/program/php/soa/Transform_plain_text_files_into_Web_pages_automatically_with_this_PHP_script/0,339028448,339272897,00.htm"&gt;http://www.builderau.com.au/program/php/soa/Transform_plain_text_files_into_Web_pages_automatically_with_this_PHP_script/0,339028448,339272897,00.htm&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-990045585306867499?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/990045585306867499/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=990045585306867499' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/990045585306867499'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/990045585306867499'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/11/text-file-to-web-page-automatically.html' title='Text File To Web Page Automatically'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-4446247413293432028</id><published>2007-11-28T08:41:00.001+07:00</published><updated>2007-11-28T08:41:26.568+07:00</updated><title type='text'>Rosolution Adjust In Delphi</title><content type='html'>Another to change resolution in delphi, I used to apply is the following&lt;p&gt;function NewRes(XRes, YRes: DWORD): Integer;&lt;br&gt;var&lt;br&gt; DevMode: TDeviceMode;&lt;br&gt;begin&lt;br&gt; EnumDisplaySettings(nil, 0, DevMode);&lt;br&gt; DevMode.dmFields := DM_PELSWIDTH or DM_PELSHEIGHT or&lt;br&gt;DM_DISPLAYFREQUENCY;&lt;br&gt; DevMode.dmPelsWidth := XRes;&lt;br&gt; DevMode.dmPelsHeight := YRes;&lt;br&gt; //DevMode.dmDisplayFrequency := Frequency;&lt;br&gt; Result := ChangeDisplaySettings(DevMode, 0);&lt;br&gt;end;&lt;p&gt;procedure TForm1.Button1Click(Sender: TObject);&lt;br&gt;begin&lt;br&gt;w:=Screen.Width;h:=Screen.Height;&lt;br&gt;if NewRes(800, 600) = DISP_CHANGE_SUCCESSFUL&lt;br&gt;then&lt;br&gt;   ShowMessage(&amp;#39;Resolution changed!&amp;#39;);&lt;br&gt;end;&lt;p&gt;procedure TForm1.Button2Click(Sender: TObject);&lt;br&gt;begin&lt;br&gt; if NewRes(w, h) = DISP_CHANGE_SUCCESSFUL&lt;br&gt;then&lt;br&gt;   ShowMessage(&amp;#39;Resolution changed Back!&amp;#39;);&lt;br&gt;end;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-4446247413293432028?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/4446247413293432028/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=4446247413293432028' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/4446247413293432028'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/4446247413293432028'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/11/rosolution-adjust-in-delphi.html' title='Rosolution Adjust In Delphi'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-551488818404267664</id><published>2007-11-28T08:38:00.001+07:00</published><updated>2007-11-28T08:38:48.601+07:00</updated><title type='text'>Change Resolution In Delphi</title><content type='html'>How to change the screen resolution in delphi? Here is the function maybe usefull&lt;p&gt;function NewRes(XRes, YRes: DWORD): Integer;&lt;br&gt;var&lt;br&gt; DevMode: TDeviceMode;&lt;br&gt;begin&lt;br&gt; EnumDisplaySettings(nil, 0, DevMode);&lt;br&gt; DevMode.dmFields := DM_PELSWIDTH or DM_PELSHEIGHT or&lt;br&gt;DM_DISPLAYFREQUENCY;&lt;br&gt; DevMode.dmPelsWidth := XRes;&lt;br&gt; DevMode.dmPelsHeight := YRes;&lt;br&gt; //DevMode.dmDisplayFrequency := Frequency;&lt;br&gt; Result := ChangeDisplaySettings(DevMode, 0);&lt;br&gt;end;&lt;p&gt;procedure TForm1.Button1Click(Sender: TObject);&lt;br&gt;begin&lt;br&gt;w:=Screen.Width;h:=Screen.Height;&lt;br&gt;if NewRes(800, 600) = DISP_CHANGE_SUCCESSFUL&lt;br&gt;then&lt;br&gt;   ShowMessage(&amp;#39;Resolution changed!&amp;#39;);&lt;br&gt;end;&lt;p&gt;procedure TForm1.Button2Click(Sender: TObject);&lt;br&gt;begin&lt;br&gt; if NewRes(w, h) = DISP_CHANGE_SUCCESSFUL&lt;br&gt;then&lt;br&gt;   ShowMessage(&amp;#39;Resolution changed Back!&amp;#39;);&lt;br&gt;end;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-551488818404267664?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/551488818404267664/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=551488818404267664' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/551488818404267664'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/551488818404267664'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/11/change-resolution-in-delphi.html' title='Change Resolution In Delphi'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-2160280979208686274</id><published>2007-11-26T17:45:00.001+07:00</published><updated>2007-11-26T17:45:32.923+07:00</updated><title type='text'>Store Report Templates In Blob</title><content type='html'>How to store report templates in blob fields in database.&lt;br&gt;Answer:&lt;p&gt;Sometimes it is useful to keep report templates in blob fields in database. If you use EK RTF report component for Delphi you may use blob field to store report template in it.&lt;p&gt;Procedures below are using TBlobStream for input/output operations.&lt;p&gt;Store template in database:&lt;p&gt;procedure StoreTemplate(Fname:string);&lt;br&gt;var BS:TBlobStream;&lt;br&gt;  begin&lt;br&gt;  ReadTempFile(FName);&lt;br&gt;  Table1.insert;&lt;br&gt;  BS:=TBlobStream.create(Table1.FieldByName(&amp;#39;Field1&amp;#39;)as TBlobField,bmWrite);&lt;br&gt;  BS.Write((PFile)^,flent);&lt;br&gt;  Table1.Post;&lt;br&gt;  Bs.Free;&lt;br&gt;  end;&lt;br&gt;  &lt;p&gt;procedure ReadTempFile(FInFile:string);&lt;br&gt;  var ActualRead : cardinal;&lt;br&gt;      FileHandle: Integer;&lt;br&gt;      SearchRec : TsearchRec;&lt;br&gt;      size:integer;&lt;br&gt;      flent:longint;&lt;br&gt;  begin&lt;br&gt;  flent:=-1;&lt;br&gt;  if FindFirst(FInFile, faAnyFile, SearchRec)=0 then&lt;br&gt;    begin&lt;br&gt;    size:=SearchRec.Size;&lt;br&gt;    GetMem(PFile,size+2);&lt;br&gt;    FileHandle := FileOpen(FInFile, fmOpenRead);&lt;br&gt;    ActualRead :=FileRead(FileHandle, PFile^, size);&lt;br&gt;    FileClose(FileHandle);&lt;br&gt;    flent:=ActualRead;&lt;br&gt;    end;&lt;br&gt;  if flent=0 then&lt;br&gt;    begin showmessage(&amp;#39;Can&amp;#39;&amp;#39;t read file&amp;#39;+FInFile); end;&lt;br&gt;  FindClose(SearchRec);&lt;br&gt;  end;&lt;br&gt;  &lt;p&gt;  Read template from database:&lt;p&gt;procedure ReadTemplate;&lt;br&gt;var BS:TBlobStream;&lt;br&gt;      buffer:pointer;&lt;br&gt;      size:longint;&lt;br&gt;  begin&lt;br&gt;  BS:=TBlobStream.create(Table1Field1,bmRead);&lt;br&gt;  size:=BS.Seek(0,soFromEnd);&lt;br&gt;  BS.Seek(0,soFromBeginning);&lt;br&gt;  GetMem(Buffer,size);&lt;br&gt;  BS.Seek(0,0);&lt;br&gt;  BS.Read((Buffer)^,size);&lt;br&gt;  BS.Free;&lt;br&gt;  //Use method SetTemplateBuffer to assign template for EK RTF component&lt;br&gt;  EKRTF1.SetTemplateBuffer(Buffer, Size);&lt;br&gt;  end;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-2160280979208686274?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/2160280979208686274/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=2160280979208686274' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/2160280979208686274'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/2160280979208686274'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/11/store-report-templates-in-blob.html' title='Store Report Templates In Blob'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-4245134554437784815</id><published>2007-11-26T16:55:00.001+07:00</published><updated>2007-11-26T16:55:41.639+07:00</updated><title type='text'>How To Use BLOB Type in Delphi</title><content type='html'>Many RDBMS usually complated with BLOB datatype. As far as I know there are many database supported blob already including the free version, which is firebird, mysql, postgresql, oracle and mssqlserver.&lt;p&gt;Blob type can be used to restore file such as image, e-book, exe file etc. And according to me, it can be used to make an update software version.&lt;p&gt;In delphi to save and load blob type is as the following:&lt;p&gt;//Save to blobstream and load&lt;br&gt;// To save a file to BLOB:&lt;br&gt;procedure TForm1.Button1Click(Sender: TObject);&lt;br&gt;var&lt;br&gt;  //blob: TBlobStream;&lt;br&gt;  blob, fs: TStream;&lt;br&gt;begin&lt;br&gt;  blob := yourDataset.CreateBlobStream(yourDataset.FieldByName(&amp;#39;YOUR_BLOB&amp;#39;), bmWrite);&lt;br&gt;  try&lt;br&gt;    blob.Seek(0, soFromBeginning);&lt;br&gt;    fs := TFileStream.Create(&amp;#39;c:\your_name.doc&amp;#39;, fmOpenRead or&lt;br&gt;      fmShareDenyWrite);&lt;br&gt;    try&lt;br&gt;      blob.CopyFrom(fs, fs.Size)&lt;br&gt;    finally&lt;br&gt;      fs.Free&lt;br&gt;    end;&lt;br&gt;  finally&lt;br&gt;    blob.Free&lt;br&gt;  end;&lt;br&gt;end;&lt;p&gt;  // To load from BLOB:&lt;p&gt;procedure TForm1.Button1Click(Sender: TObject);&lt;br&gt;var&lt;br&gt;  //blob: TBlobStream;&lt;br&gt;  blob: TStream;&lt;br&gt;begin&lt;br&gt;  blob := yourDataset.CreateBlobStream(yourDataset.FieldByName(&amp;#39;YOUR_BLOB&amp;#39;), bmRead);&lt;br&gt;  try&lt;br&gt;    blob.Seek(0, soFromBeginning);&lt;p&gt;    with TFileStream.Create(&amp;#39;c:\your_name.doc&amp;#39;, fmCreate) do&lt;br&gt;      try&lt;br&gt;        CopyFrom(blob, blob.Size)&lt;br&gt;      finally&lt;br&gt;        Free&lt;br&gt;      end;&lt;br&gt;  finally&lt;br&gt;    blob.Free&lt;br&gt;  end;&lt;br&gt;end;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-4245134554437784815?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/4245134554437784815/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=4245134554437784815' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/4245134554437784815'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/4245134554437784815'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/11/how-to-use-blob-type-in-delphi.html' title='How To Use BLOB Type in Delphi'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-1493797635520106967</id><published>2007-11-23T16:08:00.001+07:00</published><updated>2007-11-23T16:09:53.766+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Delphi'/><title type='text'>Clone Record (Delphi)</title><content type='html'>procedure CloneRecord(Dataset: TDataSet);&lt;br /&gt;var&lt;br /&gt;  aField : Variant;&lt;br /&gt;  i      : Integer;&lt;br /&gt;begin&lt;br /&gt;&lt;br /&gt;  // Create a variant Array&lt;br /&gt;  aField := VarArrayCreate([0,DataSet.Fieldcount-1],VarVariant);&lt;br /&gt;&lt;br /&gt;  // read values into the array&lt;br /&gt;  for i := 0 to (DataSet.Fieldcount-1) do&lt;br /&gt;     aField[i] := DataSet.fields[i].Value ;&lt;br /&gt;&lt;br /&gt;  DataSet.Append ;&lt;br /&gt;&lt;br /&gt;  // Put array values into new the record&lt;br /&gt;  for i := 0 to (DataSet.Fieldcount-1) do&lt;br /&gt;     DataSet.fields[i].Value := aField[i] ;&lt;br /&gt;  &lt;br /&gt;end;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-1493797635520106967?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/1493797635520106967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=1493797635520106967' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/1493797635520106967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/1493797635520106967'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/11/clone-record-delphi.html' title='Clone Record (Delphi)'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-1588260200781576302</id><published>2007-07-06T14:03:00.000+07:00</published><updated>2007-07-06T14:04:15.362+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><title type='text'>MySQLDump</title><content type='html'>How to duplicate/backup data between database both in one server or other server ?&lt;br /&gt;Answer:&lt;br /&gt;- Make sure that you have mysqladmin and mysqldump&lt;br /&gt;- Do the Following script:&lt;br /&gt;#Create the database on the destination server&lt;br /&gt;mysqladmin -u YourUserDBDest -h YourDestServer --password=YourPasswDBDest create YourDBDest&lt;br /&gt;#The Real Job Goes Here&lt;br /&gt;mysqldump -u YourUserDBSource -h YourSourceServer --password=YourPasswDBsource YourSourceDB| mysql -u YourUserDBDest -h YourDestServer --password=YourPassDBDest YourDBDest&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is an example (I use EasyPHP 2.0b1 for win) that I bundled in batch file:&lt;br /&gt;&lt;br /&gt;cd\Program Files\EasyPHP 2.0b1\mysql\bin\&lt;br /&gt;mysqladmin -u root -h Server2 --password=secret2 create db2&lt;br /&gt;mysqldump -u root -h Server1 --password=secret1 db1 | mysql -u root -h Server2 --password=secret2 db2&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-1588260200781576302?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/1588260200781576302/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=1588260200781576302' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/1588260200781576302'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/1588260200781576302'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/07/mysqldump.html' title='MySQLDump'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-7766854492835832133</id><published>2007-06-21T11:56:00.000+07:00</published><updated>2007-06-21T11:57:53.827+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Delphi'/><title type='text'>HTTP Post</title><content type='html'>Webbase application is good for any operation system,however, it's not simple to make it easy for bulk data manipulation. While, desktop application has it, easy for bulk data manipulation, user friendly and etc. &lt;br /&gt;Why? Because desktop application, delphi for example, supported event driven, while webbase is not.&lt;br /&gt;Now many webbase language, like php, combined with ajax can handle this, however, it's need huge of memory resources.&lt;br /&gt;&lt;br /&gt;In order to solve this obstacle, delphi has already prepared. With IdHTTP (Indy component), we can manipulate web application through dekstop application. &lt;br /&gt;&lt;br /&gt;The following is an example:&lt;br /&gt;&lt;br /&gt;procedure TFHttpUpload.Upload;&lt;br /&gt;var&lt;br /&gt; Stream : TIdMultipartFormDataStream;&lt;br /&gt;begin&lt;br /&gt; Stream := TIdMultipartFormDataStream.Create;&lt;br /&gt; try&lt;br /&gt;   StatusBar1.SimpleText:='Upload............';&lt;br /&gt;   Stream.AddFormField('ffield1','one');&lt;br /&gt;   Stream.AddFormField('ffield2','dua');&lt;br /&gt;   Stream.AddFile( 'fFile', fname, 'text/plain' );&lt;br /&gt;   str :=IdHTTP1.Post('http://www.myweb.com/upload.php', Stream );&lt;br /&gt;   ShowMessage('Upload Sucess :)');&lt;br /&gt; except&lt;br /&gt;   ShowMessage('Upload Fail :(');&lt;br /&gt; end;&lt;br /&gt; Stream.Free;&lt;br /&gt;end;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-7766854492835832133?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/7766854492835832133/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=7766854492835832133' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/7766854492835832133'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/7766854492835832133'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/06/http-post.html' title='HTTP Post'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-2762437455678562511</id><published>2007-05-11T08:47:00.001+07:00</published><updated>2007-06-06T08:39:32.342+07:00</updated><title type='text'>Query PHP Class</title><content type='html'>I have a php class 'Query'  that I made for delphi programmer :).&lt;br /&gt;The background of creating this class is to make easier and faster coding&lt;br /&gt;for programmer especially for delphi programmer like me :).&lt;br /&gt;This class is using mysql for the database, that we all knew already that&lt;br /&gt;mysql and php are closer family and together with apache so called 'the&lt;br /&gt;three masketeer' :))&lt;br /&gt;&lt;br /&gt;At the past, everytime I made a new php page along with mysql database, I&lt;br /&gt;have to write the same code like the following :&lt;br /&gt;$q=mysql_query("select * from table");&lt;br /&gt;if (mysql_num_rows($q)&gt;0){&lt;br /&gt;$r = mysql_fetch_array ($q);&lt;br /&gt;foreach ($r AS $key=&gt;$val)}&lt;br /&gt;{&lt;br /&gt;  .........&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;until I thought, how if I have a class like ZQuery or IBQuery in delphi. And&lt;br /&gt;I tried to write a code like the following to overcome that burden :), the&lt;br /&gt;code maybe is  perfectless, however it's helpfull especially for me :)&lt;br /&gt;Here is the code:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;class YQuery {&lt;br /&gt;   Var $ArrRecord;&lt;br /&gt;   Var $SQLText;&lt;br /&gt;   Var $ArrField;&lt;br /&gt;      Var $Dataset;&lt;br /&gt;   Var $RecordCount;&lt;br /&gt;   Var $RecNo;&lt;br /&gt;      Var $FieldByName;&lt;br /&gt;      Var $Fields;&lt;br /&gt;   Var $FieldCount;&lt;br /&gt;   Var $FieldNameIndex;&lt;br /&gt;   Var $FieldArr;&lt;br /&gt;   Var $dsState;&lt;br /&gt;   Var $TableName;&lt;br /&gt;   Var $Active;&lt;br /&gt;&lt;br /&gt;    function Connect(){&lt;br /&gt;     $db_username = "root";&lt;br /&gt;     $db_hostname = "localhost";&lt;br /&gt;     $db_password = "";&lt;br /&gt;     $db_name = "your_database_name";&lt;br /&gt;     $con = mysql_connect($db_hostname, $db_username, $db_password);&lt;br /&gt;     $db  = mysql_select_db($db_name, $con);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   function YQuery(){&lt;br /&gt;     /*Create*/&lt;br /&gt;   }&lt;br /&gt;  function Close(){    &lt;br /&gt;     /* Destroy/Free */&lt;br /&gt;    $this-&gt;Dataset-&gt;Close;&lt;br /&gt;    $this-&gt;FieldCount-&gt;Close;&lt;br /&gt;    $this-&gt;FieldNameIndex-&gt;Close;&lt;br /&gt;    $this-&gt;FieldArr-&gt;Close;&lt;br /&gt;    $this-&gt;Fields-&gt;Close;&lt;br /&gt;    mysql_free_result;&lt;br /&gt;    unset($ArrRecord,$SQLText,$ArrField,$Dataset,$RecordCount,$RecNo,&lt;br /&gt;      $FieldByName,$FieldNames,$FieldCount,$FieldNameIndex,$FieldArr,&lt;br /&gt;      $dsState,$TableName,$Active);&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   function GetSQLText(){&lt;br /&gt;   return $this-&gt;SQlText;&lt;br /&gt;   }&lt;br /&gt;   function SetSQLText($pSQl_Text){&lt;br /&gt;     $this-&gt;SQl_Text=$pSQL_Text;&lt;br /&gt;   }&lt;br /&gt;   function Open(){&lt;br /&gt;        $this-&gt;Connect();&lt;br /&gt;     $this-&gt;Dataset= mysql_query($this-&gt;SQLText) or die (mysql_error());&lt;br /&gt;     $this-&gt;FieldCount =mysql_num_fields($this-&gt;Dataset);&lt;br /&gt;&lt;br /&gt;     for ($i=0;$i&lt;$this-&gt;FieldCount;$i++) {&lt;br /&gt;      $str=$str."&amp;".mysql_field_name($this-&gt;Dataset, $i)."=".$i;&lt;br /&gt;     };&lt;br /&gt;&lt;br /&gt;     /*buang huruf "&amp;" pertama */&lt;br /&gt;      $str=substr_replace($str,'',0,1);&lt;br /&gt;&lt;br /&gt;     $this-&gt;FieldNameIndex=$str;&lt;br /&gt;&lt;br /&gt;     /*Isi Array FieldArr[Field Ke-][baris Ke-]*/&lt;br /&gt;     $j=0;&lt;br /&gt;     $this-&gt;RecNo=0;&lt;br /&gt;     while ($this-&gt;Fields=mysql_fetch_row($this-&gt;Dataset)){&lt;br /&gt;     for ($i=0;$i&lt;$this-&gt;FieldCount;$i++) {&lt;br /&gt;      $this-&gt;FieldArr[$i][$j]=$this-&gt;Fields[$i];&lt;br /&gt;     };&lt;br /&gt;     $j++;&lt;br /&gt;   };&lt;br /&gt;   if ($j&gt;0) {&lt;br /&gt;      $this-&gt;RecNo=$j;&lt;br /&gt;      $this-&gt;RecordCount=$j;&lt;br /&gt;   };&lt;br /&gt;  $this-&gt;Active=1;&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;   function GetFieldByName($pName){&lt;br /&gt;     parse_str($this-&gt;FieldNameIndex);&lt;br /&gt;  return $this-&gt;FieldArr[$$pName][$this-&gt;RecNo-1];&lt;br /&gt;   }&lt;br /&gt;   function SetFieldByName($pName,$Value){&lt;br /&gt;     parse_str($this-&gt;FieldNameIndex);&lt;br /&gt;  $this-&gt;TmpArr[$$pName]=$Value;&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;   function Next(){&lt;br /&gt;     if ($this-&gt;RecNo&lt;$this-&gt;RecordCount) {&lt;br /&gt;       $this-&gt;RecNo=$this-&gt;RecNo+1;&lt;br /&gt;  };&lt;br /&gt;   }&lt;br /&gt;   function First(){&lt;br /&gt;       if ($this-&gt;RecordCount&gt;0) {&lt;br /&gt;       $this-&gt;RecNo=1;&lt;br /&gt;  };&lt;br /&gt;&lt;br /&gt;   }&lt;br /&gt;   function Previous(){&lt;br /&gt;     if ($this-&gt;RecNo&gt;1) {&lt;br /&gt;       $this-&gt;RecNo=$this-&gt;RecNo-1;&lt;br /&gt;  };&lt;br /&gt;   }&lt;br /&gt;   function Last(){&lt;br /&gt;      if ($this-&gt;RecordCount&gt;0) {&lt;br /&gt;       $this-&gt;RecNo=$this-&gt;RecordCount;&lt;br /&gt;  };&lt;br /&gt;   }&lt;br /&gt;   function GotoRow($aRow){&lt;br /&gt;  if ($Row&lt;=$this-&gt;RecordCount-1) {&lt;br /&gt;       $this-&gt;RecNo=$aRow;&lt;br /&gt;  };&lt;br /&gt;   }&lt;br /&gt;   function Post(){&lt;br /&gt;       echo "Possss";&lt;br /&gt;     if ($this-&gt;dsState=='Insert'){&lt;br /&gt;      $str_ins="insert into ".$this-&gt;TableName."(";&lt;br /&gt;      for ($i=0;$i&lt;$this-&gt;FieldCount;$i++) {&lt;br /&gt;       $str_field=$str_field.",".mysql_field_name($this-&gt;Dataset, $i);&lt;br /&gt;     };&lt;br /&gt;&lt;br /&gt;     /*buang huruf "," pertama*/&lt;br /&gt;     $str_field=substr_replace($str_field,'',0,1).")";&lt;br /&gt;&lt;br /&gt;     $str_field= $str_field." values(";&lt;br /&gt;     for ($i=0; $i &lt; $this-&gt;FieldCount; $i++) {&lt;br /&gt;      parse_str($this-&gt;FieldNameIndex);&lt;br /&gt;      $fnm=mysql_field_name($this-&gt;Dataset, $i);&lt;br /&gt;      $type  =mysql_field_type($this-&gt;Dataset, $i);&lt;br /&gt;&lt;br /&gt;      /*Siapkan Nilai dan format penulisannya*/&lt;br /&gt;      $str_value=$str_value.",".$this-&gt;Quoted($this-&gt;TmpArr[$$fnm],$type);&lt;br /&gt;     };&lt;br /&gt;&lt;br /&gt;     /*buang huruf "," pertama*/&lt;br /&gt;     $str_value=substr_replace($str_value,'',0,1).")";&lt;br /&gt;&lt;br /&gt;     $sqlstr=$str_ins.$str_field.$str_value;&lt;br /&gt;     echo $sqlstr;&lt;br /&gt;     } ;&lt;br /&gt;     if ($this-&gt;dsState=='Edit'){&lt;br /&gt;      $str_upd="update ".$this-&gt;TableName." set ";&lt;br /&gt;      for ($i=0; $i &lt; $this-&gt;FieldCount; $i++) {&lt;br /&gt;      parse_str($this-&gt;FieldNameIndex);&lt;br /&gt;      $fnm=mysql_field_name($this-&gt;Dataset, $i);&lt;br /&gt;      $type  =mysql_field_type($this-&gt;Dataset, $i);&lt;br /&gt;&lt;br /&gt;      /*Siapkan Nilai,Klausa Where dan format penulisannya*/&lt;br /&gt;           $str_value=$str_value.",".$fnm."=".$this-&gt;Quoted($this-&gt;TmpArr[$$fnm],$type);&lt;br /&gt;      $nilai=$this-&gt;Quoted($this-&gt;GetFieldByName($fnm),$type);&lt;br /&gt;      if ($nilai=='null'){&lt;br /&gt;          $str_whr=$str_whr." and ".$fnm." is ".$nilai;&lt;br /&gt;      } else {&lt;br /&gt;       $str_whr=$str_whr." and ".$fnm."=".$nilai;&lt;br /&gt;      };&lt;br /&gt;     };&lt;br /&gt;&lt;br /&gt;    /*buang huruf "," pertama*/&lt;br /&gt;       $str_value=substr_replace($str_value,'',0,1);&lt;br /&gt;&lt;br /&gt;         $sqlstr=$str_upd." ".$str_value." where 1=1 ".$str_whr;&lt;br /&gt;     } ;&lt;br /&gt;           //echo $sqlstr;&lt;br /&gt;     mysql_query($sqlstr);&lt;br /&gt;     $this-&gt;dsState='Browse';&lt;br /&gt;&lt;br /&gt;     /*Refresh*/;&lt;br /&gt;     $this-&gt;Open();&lt;br /&gt;   }&lt;br /&gt;      /* end Post-------*/&lt;br /&gt;&lt;br /&gt;    function Delete(){&lt;br /&gt;     if ($this-&gt;Active!=1) {&lt;br /&gt;    echo "Not Open Yet! &lt;br&gt;";&lt;br /&gt;    break;&lt;br /&gt;  };&lt;br /&gt;    $str_del="delete from ".$this-&gt;TableName;&lt;br /&gt;    for ($i=0; $i &lt; $this-&gt;FieldCount; $i++) {&lt;br /&gt;    parse_str($this-&gt;FieldNameIndex);&lt;br /&gt;    $fnm=mysql_field_name($this-&gt;Dataset, $i);&lt;br /&gt;    $type  =mysql_field_type($this-&gt;Dataset, $i);&lt;br /&gt;&lt;br /&gt;    /*Siapkan Klause Where  dan format penulisannya*/&lt;br /&gt;    $nilai=$this-&gt;Quoted($this-&gt;GetFieldByName($fnm),$type);&lt;br /&gt;    if ($nilai=='null'){&lt;br /&gt;     $str_whr=$str_whr." and ".$fnm." is ".$nilai;&lt;br /&gt;    } else {&lt;br /&gt;     $str_whr=$str_whr." and ".$fnm."=".$nilai;&lt;br /&gt;    };&lt;br /&gt;   };&lt;br /&gt;&lt;br /&gt;  $sqlstr=$str_del." where 1=1 ".$str_whr;&lt;br /&gt;  //echo $sqlstr;&lt;br /&gt;  mysql_query($sqlstr);&lt;br /&gt;     $this-&gt;dsState='Browse';&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;    function Edit(){&lt;br /&gt;     if ($this-&gt;Active!=1) {&lt;br /&gt;    echo "Not Open Yet! &lt;br&gt;";&lt;br /&gt;    break;&lt;br /&gt;  };&lt;br /&gt;     $this-&gt;dsState='Edit';&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;     function Insert(){&lt;br /&gt;     if ($this-&gt;Active!=1) {&lt;br /&gt;    echo "Not Open Yet! &lt;br&gt;";&lt;br /&gt;    break;&lt;br /&gt;  };&lt;br /&gt;     $this-&gt;dsState='Insert';&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt; /* fungsi penyiapan quote jika klausa where tipe datanya string,date,time&lt;br /&gt;dll*/&lt;br /&gt; function Quoted($str,$data_type) {&lt;br /&gt;  switch ($data_type) {&lt;br /&gt;       case "string":&lt;br /&gt;         if ($str=="") {&lt;br /&gt;            return "null";&lt;br /&gt;          } else {&lt;br /&gt;         return "'".$str."'";&lt;br /&gt;      };&lt;br /&gt;                        break;&lt;br /&gt;       case "time":&lt;br /&gt;         if ($str=="") {&lt;br /&gt;            return "null";&lt;br /&gt;          } else {&lt;br /&gt;        return "'".$str."'";&lt;br /&gt;      };&lt;br /&gt;                        break;&lt;br /&gt;       case "date":&lt;br /&gt;         if ($str=="") {&lt;br /&gt;            return "null";&lt;br /&gt;          } else {&lt;br /&gt;       //return&lt;br /&gt;"'".Substr($str,6,4)."-".Substr($str,3,2)."-".Substr($str,0,2)."'";&lt;br /&gt;       return "'".$str."'";&lt;br /&gt;      };&lt;br /&gt;      break;&lt;br /&gt;       case "int":&lt;br /&gt;         if ($str=="") {&lt;br /&gt;            return "null";&lt;br /&gt;          } else {&lt;br /&gt;       return $str;&lt;br /&gt;      };&lt;br /&gt;      break;&lt;br /&gt;       case "real":&lt;br /&gt;         if ($str=="") {&lt;br /&gt;            return "null";&lt;br /&gt;          } else {&lt;br /&gt;       return $str;&lt;br /&gt;      };&lt;br /&gt;      break;&lt;br /&gt;     };&lt;br /&gt; }&lt;br /&gt;};&lt;br /&gt;&lt;br /&gt;?&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;and use this following code to test drive :)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;?php&lt;br /&gt;  //contoh Penggunaan:&lt;br /&gt;  include("YComponent.php");&lt;br /&gt;  $Query=new YQuery; //Create&lt;br /&gt;  $Query-&gt;SQLText='select * from tbl_menu order by kode'; //Masukkan query&lt;br /&gt;  $Query-&gt;TableName='menu';        //jangan lupa nama tabelnya berguna waktu&lt;br /&gt;insert,update,delete;&lt;br /&gt;  $Query-&gt;Open();          //Open Query&lt;br /&gt;  $Query-&gt;First();          //Ke Baris Pertama&lt;br /&gt;&lt;br /&gt;  /*Demo Loop*/&lt;br /&gt;  for ($i=0;$i&lt;=$Query-&gt;RecordCount-1;$i++){&lt;br /&gt;    echo&lt;br /&gt;$Query-&gt;GetFieldByName("kode")."-".$Query-&gt;GetFieldByName("nama")."&lt;br&gt;";&lt;br /&gt;     $Query-&gt;Next();         //Ke Baris Berikutnya&lt;br /&gt;  };&lt;br /&gt;&lt;br /&gt;  $Query-&gt;GotoRow(3);&lt;br /&gt;  echo "&lt;br&gt; GotoRow(".$Query-&gt;RecNo.")&lt;br /&gt;".$Query-&gt;GetFieldByName("kode")."-".$Query-&gt;GetFieldByName("nama")."&lt;br&gt;";&lt;br /&gt;&lt;br /&gt;  $Query-&gt;Previous();&lt;br /&gt;  echo "&lt;br&gt; Previous:".$Query-&gt;RecNo."&lt;br /&gt;".$Query-&gt;GetFieldByName("kode")."-".$Query-&gt;GetFieldByName("nama")."&lt;br&gt;";&lt;br /&gt;&lt;br /&gt;  /*Demo Insert Data*/;&lt;br /&gt;  /*$Query-&gt;Insert();        //Persiapkan Flag Insert;&lt;br /&gt;  $Query-&gt;SetFieldByName("kode","kode baru"); //isi field kode='kode baru'&lt;br /&gt;  $Query-&gt;SetFieldByName("nama","nam baru"); //isi field nama='nama baru'&lt;br /&gt;  $Query-&gt;SetFieldByName("tingkat","0");&lt;br /&gt;  $Query-&gt;SetFieldByName("sts_dtl",1);&lt;br /&gt;  $Query-&gt;SetFieldByName("nama_file","nmfilleee");&lt;br /&gt;  $Query-&gt;Post();&lt;br /&gt;  */&lt;br /&gt;&lt;br /&gt;  /*Demo Update Data*/;&lt;br /&gt;  /*$Query-&gt;Last();        //Misal mo edit record Terakhir;&lt;br /&gt;  $Query-&gt;Edit();        //Persiapkan Flag Update;&lt;br /&gt;  $Query-&gt;SetFieldByName("kode","kode update"); //isi field kode='kode&lt;br /&gt;update'&lt;br /&gt;  $Query-&gt;SetFieldByName("nama","nam update"); //isi field nama='nama&lt;br /&gt;update'&lt;br /&gt;  $Query-&gt;Post();&lt;br /&gt;  */&lt;br /&gt;&lt;br /&gt;  /*Demo Delete Data*/&lt;br /&gt;  /*$Query-&gt;Last();        //Misal mo delete record Terakhir;&lt;br /&gt;  $Query-&gt;Delete();&lt;br /&gt;  $Query-&gt;Post();&lt;br /&gt;  */&lt;br /&gt;&lt;br /&gt;  $Query-&gt;Close();        //Bebaskan Memory;&lt;br /&gt;?&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-2762437455678562511?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/2762437455678562511'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/2762437455678562511'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/05/query-php-class.html' title='Query PHP Class'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-6853833781402697897</id><published>2007-05-08T15:16:00.000+07:00</published><updated>2007-05-11T13:53:36.185+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><title type='text'>require vs include</title><content type='html'>php, to combine scripts from several files is by using statements include, &lt;br /&gt;include_once,require and require_once.&lt;br /&gt;So, what's the different between them ?&lt;br /&gt;&lt;br /&gt;include vs include_once:&lt;br /&gt;I will describe it by refering to the following example:&lt;br /&gt;&lt;br /&gt;suppose we have a file one.php consist of code:&lt;br /&gt;echo "Welcome to the jungle"&lt;br /&gt;&lt;br /&gt;and we have a file two.php consist of code:&lt;br /&gt;echo "By Tarzan"&lt;br /&gt;&lt;br /&gt;then we like to combine one.php code into two.php&lt;br /&gt;with code like this:&lt;br /&gt;&lt;br /&gt;include("one.php");&lt;br /&gt;include("one.php");&lt;br /&gt;include("one.php");&lt;br /&gt;echo "By Tarzan"&lt;br /&gt;&lt;br /&gt;the result would be :&lt;br /&gt;&lt;br /&gt;Welcome to the jungle&lt;br /&gt;Welcome to the jungle&lt;br /&gt;Welcome to the jungle&lt;br /&gt;By Tarzan&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;if the we change the code like this:&lt;br /&gt;include_once("one.php");&lt;br /&gt;include_once("one.php");&lt;br /&gt;include_once("one.php");&lt;br /&gt;echo "By Tarzan"&lt;br /&gt;&lt;br /&gt;the result would be :&lt;br /&gt;&lt;br /&gt;Welcome to the jungle&lt;br /&gt;By Tarzan&lt;br /&gt;&lt;br /&gt;because 'include_once' would eliminate all of same values and would display &lt;br /&gt;once, while 'include' would display all of them many times depend on how &lt;br /&gt;many times one.php was repeated&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;require vs require_once:&lt;br /&gt;the same as include vs include_once&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;include vs require:&lt;br /&gt;viewed from the function of combining code, both of include and require is &lt;br /&gt;same.&lt;br /&gt;the different is when error occure, 'require' would not execute  all of the &lt;br /&gt;next codes , while 'include' would execute.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;that's all :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-6853833781402697897?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/6853833781402697897/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=6853833781402697897' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/6853833781402697897'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/6853833781402697897'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/05/require-vs-include.html' title='require vs include'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-1516507762423667687</id><published>2007-05-04T15:24:00.000+07:00</published><updated>2007-05-11T13:55:48.801+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='PHP'/><title type='text'>PHP Class</title><content type='html'>I found a great thing in PHP 5, which is the real class concept has already &lt;br /&gt;adopted ( similar to other language like delphi). So that, OOP (Object &lt;br /&gt;Oriented Programming) can be implemented very well.&lt;br /&gt;&lt;br /&gt;In general, PHP class has structure like this&lt;br /&gt;&lt;br /&gt;class aname() {&lt;br /&gt;  //definition of variable, in delphi called property&lt;br /&gt;  var ....&lt;br /&gt;&lt;br /&gt;  //constructor, in delphi would be Create&lt;br /&gt;  function __constructor(){&lt;br /&gt;   //initial value should be placed here&lt;br /&gt;   ......&lt;br /&gt;  }&lt;br /&gt; function a(){&lt;br /&gt;   ...&lt;br /&gt;  }&lt;br /&gt;  function b(){&lt;br /&gt;    ....&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Ideally, a class should be has Get and Set method&lt;br /&gt;Get is to retrieve data from a class&lt;br /&gt;Set is to place data into a class&lt;br /&gt;&lt;br /&gt;example:&lt;br /&gt;&lt;br /&gt;class person() {&lt;br /&gt;  var $IdentityNo,&lt;br /&gt;       $Name;&lt;br /&gt;&lt;br /&gt;  function __construct(){&lt;br /&gt;    $this-&gt;$IdentityNo="";&lt;br /&gt;    $this-&gt;$Name="";&lt;br /&gt;   }&lt;br /&gt;&lt;br /&gt;  function GetIdentityNo(){&lt;br /&gt;    return $this-&gt;$IdentityNo;&lt;br /&gt;  }&lt;br /&gt;  function GetName(){&lt;br /&gt;    return $this-&gt;$Name;&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  function SetIdentityNo($AIdentityNo){&lt;br /&gt;    $this-&gt;$IdentityNo=$AIdentityNo;&lt;br /&gt;  }&lt;br /&gt;  function SetIdentityNo($AName){&lt;br /&gt;    $this-&gt;$Name=$AName;&lt;br /&gt;  }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;usage:&lt;br /&gt;&lt;br /&gt;$p=new person;                    //construc&lt;br /&gt;$p-&gt;SetIdentityNo("001");   //Set Identity No&lt;br /&gt;$p-&gt;SetName("Paijo");        //Set Name&lt;br /&gt;&lt;br /&gt;echo $p-&gt;GetIdentityNo();  //print Identity No&lt;br /&gt;echo $p-&gt;GetName();        //print Name&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;that's a simple, right :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-1516507762423667687?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/1516507762423667687/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=1516507762423667687' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/1516507762423667687'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/1516507762423667687'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/05/php-class.html' title='PHP Class'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-5273172887389625471</id><published>2007-04-11T18:01:00.001+07:00</published><updated>2007-04-12T08:13:31.257+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><title type='text'>MySQL Boolean/Integer Result Field</title><content type='html'>In mysql if we make a query like this:&lt;br /&gt; &lt;br /&gt;select 1&lt;0  -&gt;the result would be 0 (incorrect because 1 is not less then 0)&lt;br /&gt;select 1&gt;0  -&gt;the result would be 1 (correct because 1 is not more then 0)&lt;br /&gt; &lt;br /&gt;it's mean that : 0=False, 1=True&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-5273172887389625471?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/5273172887389625471/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=5273172887389625471' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/5273172887389625471'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/5273172887389625471'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/04/mysql-booleaninteger-result-field.html' title='MySQL Boolean/Integer Result Field'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-5695288277813735372</id><published>2007-03-07T15:50:00.002+07:00</published><updated>2007-03-07T16:24:32.554+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Delphi'/><title type='text'>Form Inherited</title><content type='html'>Do you experience with delphi form identically many time? If you do, you need to make it simple with inherited. &lt;br /&gt;Actually this method is not something new, because delphi is OOP (Object Oriented Programming) and form is class. If you understanding class very well, you will not find serious trouble with this methode. &lt;br /&gt;However this method doesn't need understanding of class, because this is very simple.&lt;br /&gt;OK, let starting with :&lt;br /&gt;-new application at your delphi and you would have form1 for default&lt;br /&gt;-place one button and save your new application as project1 and form1 as form1&lt;br /&gt;-click File-&gt;New-&gt;Other-&gt;project1-&gt;form1&lt;br /&gt;-notice what happen :)&lt;br /&gt;-place another button on your form&lt;br /&gt;-Now you have Form2 identically with Form1, but you added with one button&lt;br /&gt;&lt;br /&gt;it's simple, right?&lt;br /&gt;&lt;br /&gt;In any complex form with code inside, this would help much without coding same things  many times :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-5695288277813735372?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/5695288277813735372/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=5695288277813735372' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/5695288277813735372'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/5695288277813735372'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/03/form-inherited_07.html' title='Form Inherited'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-4718275404498860787</id><published>2007-03-03T12:24:00.000+07:00</published><updated>2007-03-03T12:27:49.004+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='MySQL'/><category scheme='http://www.blogger.com/atom/ns#' term='Firebird'/><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><title type='text'>Getting Up Level</title><content type='html'>Getting Up Level&lt;br /&gt;&lt;br /&gt;Leveling Database structure, is maight be not awkward for many programmer. I got problem when getting the up/upper level of some code. At last  I found this way :&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Suppose you have a data structure like this:&lt;br /&gt;&lt;br /&gt;code varchar(10)&lt;br /&gt;name varchar(100)&lt;br /&gt;parent varchar(10)&lt;br /&gt;level integer&lt;br /&gt;&lt;br /&gt;code  name           parent    level&lt;br /&gt;------------------------------------&lt;br /&gt;A1    AOne                       1&lt;br /&gt;A10   AOnezero       A1          2&lt;br /&gt;A11   AOneOne        A1          2&lt;br /&gt;A110  AOneOnezero    A11         3&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;what is the up level 1 code of A110?&lt;br /&gt;&lt;br /&gt;answer:&lt;br /&gt;make the sql like this:&lt;br /&gt;select * from table where level=1 and 'A110' like concat(code,'%')&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-4718275404498860787?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/4718275404498860787/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=4718275404498860787' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/4718275404498860787'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/4718275404498860787'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/03/getting-up-level.html' title='Getting Up Level'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-8232598656342989803</id><published>2007-02-24T13:23:00.000+07:00</published><updated>2007-02-24T13:44:34.112+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Database'/><title type='text'>Differences between CHAR and VARCHAR</title><content type='html'>Many people believe that VARCHAR is better because it stores only actual data, while CHAR is stored in full length. It is not true. In fact, both CHAR and VARCHAR are stored in memory buffer in their full, declared length; when the row is stored on disk, then RLE compression algorithm is used to compress whole row, i.e. CHARs, VARCHARs, INTEGERs, DATEs, etc. all together. So if you want to save space, CHARs are slightly better than VARCHARs (the differenece is that VARCHAR stores string length in two bytes).&lt;br /&gt;There is also a bug that causes that VARCHAR does not properly clean string tail if you assign shorter string, thus causing worse compression. (this problem is fixed in Firebird-0.9.4)&lt;br /&gt;&lt;br /&gt;Many people also believe that VARCHAR sends over network only actual data, while CHAR is sent in full length. It is not true either. Communication between client and server is done via messages of fixed length. For this reason both CHAR and VARCHAR are sent in their full declared length. (this problem is fixed in IB-6.5)&lt;br /&gt;&lt;br /&gt;So decision whether use CHAR or VARCHAR should be based solely on application's requirements. E.g. store fixed length codes in CHAR, store names in VARCHAR (to allow correct concatenating).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-8232598656342989803?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/8232598656342989803/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=8232598656342989803' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/8232598656342989803'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/8232598656342989803'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/02/differences-between-char-and-varchar.html' title='Differences between CHAR and VARCHAR'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-3426102250648310548</id><published>2007-02-24T13:21:00.000+07:00</published><updated>2007-02-24T13:22:22.227+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Firebird'/><title type='text'>Date and Time Calculations (Firebird)</title><content type='html'>Date and Time Calculations&lt;br /&gt;When doing arithmetic operations with TIMESTAMP values, Firebird works with them as decimal number, where&lt;br /&gt;&lt;br /&gt;    * the integral fraction is the number of days&lt;br /&gt;    * the decimal fraction is the part of a day&lt;br /&gt;&lt;br /&gt;For example:&lt;br /&gt;&lt;br /&gt;    * Two days: 2.0&lt;br /&gt;    * One hour: 1.0/24.0&lt;br /&gt;    * One minute: 1.0/1440.0&lt;br /&gt;    * One second: 1.0/86400.0&lt;br /&gt;&lt;br /&gt;Extracting the smaller units from a TIMESTAMP value:&lt;br /&gt;&lt;br /&gt;    * Number of seconds: VALUE*86400.0&lt;br /&gt;    * Number of minutes: VALUE*1440.0&lt;br /&gt;    * Number of hours: VALUE*24.0&lt;br /&gt;&lt;br /&gt;Don't forget the decimal point in the numbers (e.g. 1.0), otherwise the result will be integer. I spent a lot time debugging a calculation that didn't work because I was dividing by an integer. Since that time, I remember.&lt;br /&gt;Posted by Dan : 2:04 PM&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;firebird: &lt;br /&gt;tgl jam server sekarang : current_timestamp&lt;br /&gt;tgl                     : CAST ('today' AS TIMESTAMP)&lt;br /&gt;jam                     : extract(hour from current_timestamp)||':'||extract(minute from current_timestamp)||':'||extract(second from current_timestamp)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-3426102250648310548?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/3426102250648310548/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=3426102250648310548' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/3426102250648310548'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/3426102250648310548'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/02/date-and-time-calculations-firebird.html' title='Date and Time Calculations (Firebird)'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-2494890394764829801</id><published>2007-02-24T13:15:00.000+07:00</published><updated>2007-02-24T13:17:12.713+07:00</updated><title type='text'>Export StringGrid to An Excel File (way two)</title><content type='html'>#144: Fast data transfer to MS Excel&lt;br /&gt;&lt;br /&gt;Anyone who worked with OLE automation, know that OLE is very slowly. Especially if you work using late binding (which have a lot of other advantages which early binding haven't)&lt;br /&gt;&lt;br /&gt;A reason of bad performance is the next: every command (method or property) which you access (no matter in read or write mode) will be interpretated (a-la script). I mean that this command must be found in table of available methods/properties by string name and only if found, a physical memory address for execution will be calculated.&lt;br /&gt;&lt;br /&gt;So if your code contain a lot of access to methods/properties, your code will be slow.&lt;br /&gt;&lt;br /&gt;For example, you need transfer some data from Delphi application into xls-spreadsheet.&lt;br /&gt;&lt;br /&gt;You can solve a task in two different ways (now I describe only late binding for OLE automation and don't describe another methods):&lt;br /&gt;&lt;br /&gt;    * to navigate thru own data and export every data in required cell&lt;br /&gt;    * to prepare a variant array with copied data and apply this array with data into desired range of cells&lt;br /&gt;&lt;br /&gt;I must say that second method will be faster than first because you'll call less commands from OLE object and main code will be executed without OLE automation.&lt;br /&gt;&lt;br /&gt;Small sample: to export some StringGrid into xls-file.&lt;br /&gt;&lt;br /&gt;var&lt;br /&gt;  xls, wb, Range: OLEVariant;&lt;br /&gt;  arrData: Variant;&lt;br /&gt;begin&lt;br /&gt;  {create variant array where we'll copy our data}&lt;br /&gt;  arrData := VarArrayCreate([1, yourStringGrid.RowCount, 1, yourStringGrid.ColCount], varVariant);&lt;br /&gt;&lt;br /&gt;  {fill array}&lt;br /&gt;  for i := 1 to yourStringGrid.RowCount do&lt;br /&gt;    for j := 1 to yourStringGrid.ColCount do&lt;br /&gt;      arrData[i, j] := yourStringGrid.Cells[j-1, i-1];&lt;br /&gt;&lt;br /&gt;  {initialize an instance of Excel}&lt;br /&gt;  xls := CreateOLEObject('Excel.Application');&lt;br /&gt;&lt;br /&gt;  {create workbook}&lt;br /&gt;  wb := xls.Workbooks.Add;&lt;br /&gt;&lt;br /&gt;  {retrieve a range where data must be placed}&lt;br /&gt;  Range := wb.WorkSheets[1].Range[wb.WorkSheets[1].Cells[1, 1],&lt;br /&gt;                                  wb.WorkSheets[1].Cells[yourStringGrid.RowCount, yourStringGrid.ColCount]];&lt;br /&gt;&lt;br /&gt;  {copy data from allocated variant array}&lt;br /&gt;  Range.Value := arrData;&lt;br /&gt;&lt;br /&gt;  {show Excel with our data}&lt;br /&gt;  xls.Visible := True;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;Of course, you must understand that such method is not good for large data arrays because to allocate in memory large array is not easy task. You must find some optimal size for data transfer (for example, to copy every 10 rows) and as result you'll receive an optimal code both for memory use and performance.&lt;br /&gt;&lt;br /&gt;Anyway more faster way to transfer data is not use OLE at all:-) You can use my TSMExportToXLS component from SMExport suite for this task. There is implemented a direct xls-file creation which doesn't require installed MS Excel at all..&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-2494890394764829801?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/2494890394764829801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=2494890394764829801' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/2494890394764829801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/2494890394764829801'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/02/export-stringgrid-to-excel-file-way-two.html' title='Export StringGrid to An Excel File (way two)'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-3336838923000556140</id><published>2007-02-24T13:12:00.000+07:00</published><updated>2007-02-24T13:15:02.942+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Delphi'/><title type='text'>Export StringGrid to An Excel File (way one)</title><content type='html'>{1. With OLE Automation }&lt;br /&gt;&lt;br /&gt;uses&lt;br /&gt;  ComObj;&lt;br /&gt;&lt;br /&gt;function RefToCell(ARow, ACol: Integer): string;&lt;br /&gt;begin&lt;br /&gt;  Result := Chr(Ord('A') + ACol - 1) + IntToStr(ARow);&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;function SaveAsExcelFile(AGrid: TStringGrid; ASheetName, AFileName: string): Boolean;&lt;br /&gt;const&lt;br /&gt;  xlWBATWorksheet = -4167;&lt;br /&gt;var&lt;br /&gt;  Row, Col: Integer;&lt;br /&gt;  GridPrevFile: string;&lt;br /&gt;  XLApp, Sheet, Data: OLEVariant;&lt;br /&gt;  i, j: Integer;&lt;br /&gt;begin&lt;br /&gt;  // Prepare Data&lt;br /&gt;  Data := VarArrayCreate([1, AGrid.RowCount, 1, AGrid.ColCount], varVariant);&lt;br /&gt;  for i := 0 to AGrid.ColCount - 1 do&lt;br /&gt;    for j := 0 to AGrid.RowCount - 1 do&lt;br /&gt;      Data[j + 1, i + 1] := AGrid.Cells[i, j];&lt;br /&gt;  // Create Excel-OLE Object&lt;br /&gt;  Result := False;&lt;br /&gt;  XLApp := CreateOleObject('Excel.Application');&lt;br /&gt;  try&lt;br /&gt;    // Hide Excel&lt;br /&gt;    XLApp.Visible := False;&lt;br /&gt;    // Add new Workbook&lt;br /&gt;    XLApp.Workbooks.Add(xlWBatWorkSheet);&lt;br /&gt;    Sheet := XLApp.Workbooks[1].WorkSheets[1];&lt;br /&gt;    Sheet.Name := ASheetName;&lt;br /&gt;    // Fill up the sheet&lt;br /&gt;    Sheet.Range[RefToCell(1, 1), RefToCell(AGrid.RowCount,&lt;br /&gt;      AGrid.ColCount)].Value := Data;&lt;br /&gt;    // Save Excel Worksheet&lt;br /&gt;    try&lt;br /&gt;      XLApp.Workbooks[1].SaveAs(AFileName);&lt;br /&gt;      Result := True;&lt;br /&gt;    except&lt;br /&gt;      // Error ?&lt;br /&gt;    end;&lt;br /&gt;  finally&lt;br /&gt;    // Quit Excel&lt;br /&gt;    if not VarIsEmpty(XLApp) then&lt;br /&gt;    begin&lt;br /&gt;      XLApp.DisplayAlerts := False;&lt;br /&gt;      XLApp.Quit;&lt;br /&gt;      XLAPP := Unassigned;&lt;br /&gt;      Sheet := Unassigned;&lt;br /&gt;    end;&lt;br /&gt;  end;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;// Example:&lt;br /&gt;&lt;br /&gt;procedure TForm1.Button1Click(Sender: TObject);&lt;br /&gt;begin&lt;br /&gt;  if SaveAsExcelFile(stringGrid1, 'My Stringgrid Data', 'c:\MyExcelFile.xls') then&lt;br /&gt;    ShowMessage('StringGrid saved!');&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;{**************************************************************}&lt;br /&gt;{2. Without OLE }&lt;br /&gt;&lt;br /&gt;procedure XlsWriteCellLabel(XlsStream: TStream; const ACol, ARow: Word;&lt;br /&gt;  const AValue: string);&lt;br /&gt;var&lt;br /&gt;  L: Word;&lt;br /&gt;const&lt;br /&gt;  {$J+}&lt;br /&gt;  CXlsLabel: array[0..5] of Word = ($204, 0, 0, 0, 0, 0);&lt;br /&gt;  {$J-}&lt;br /&gt;begin&lt;br /&gt;  L := Length(AValue);&lt;br /&gt;  CXlsLabel[1] := 8 + L;&lt;br /&gt;  CXlsLabel[2] := ARow;&lt;br /&gt;  CXlsLabel[3] := ACol;&lt;br /&gt;  CXlsLabel[5] := L;&lt;br /&gt;  XlsStream.WriteBuffer(CXlsLabel, SizeOf(CXlsLabel));&lt;br /&gt;  XlsStream.WriteBuffer(Pointer(AValue)^, L);&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;function SaveAsExcelFile(AGrid: TStringGrid; AFileName: string): Boolean;&lt;br /&gt;const&lt;br /&gt;  {$J+} CXlsBof: array[0..5] of Word = ($809, 8, 00, $10, 0, 0); {$J-}&lt;br /&gt;  CXlsEof: array[0..1] of Word = ($0A, 00);&lt;br /&gt;var&lt;br /&gt;  FStream: TFileStream;&lt;br /&gt;  I, J: Integer;&lt;br /&gt;begin&lt;br /&gt;  Result := False;&lt;br /&gt;  FStream := TFileStream.Create(PChar(AFileName), fmCreate or fmOpenWrite);&lt;br /&gt;  try&lt;br /&gt;    CXlsBof[4] := 0;&lt;br /&gt;    FStream.WriteBuffer(CXlsBof, SizeOf(CXlsBof));&lt;br /&gt;    for i := 0 to AGrid.ColCount - 1 do&lt;br /&gt;      for j := 0 to AGrid.RowCount - 1 do&lt;br /&gt;        XlsWriteCellLabel(FStream, I, J, AGrid.cells[i, j]);&lt;br /&gt;    FStream.WriteBuffer(CXlsEof, SizeOf(CXlsEof));&lt;br /&gt;    Result := True;&lt;br /&gt;  finally&lt;br /&gt;    FStream.Free;&lt;br /&gt;  end;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;// Example:&lt;br /&gt;&lt;br /&gt;procedure TForm1.Button2Click(Sender: TObject);&lt;br /&gt;begin&lt;br /&gt;  if SaveAsExcelFile(StringGrid1, 'c:\MyExcelFile.xls') then&lt;br /&gt;    ShowMessage('StringGrid saved!');&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;{**************************************************************}&lt;br /&gt;{3. Code by Reinhard Schatzl }&lt;br /&gt;&lt;br /&gt;uses&lt;br /&gt;  ComObj;&lt;br /&gt;&lt;br /&gt;// Hilfsfunktion für StringGridToExcelSheet&lt;br /&gt;// Helper function for StringGridToExcelSheet&lt;br /&gt;function RefToCell(RowID, ColID: Integer): string;&lt;br /&gt;var&lt;br /&gt;  ACount, APos: Integer;&lt;br /&gt;begin&lt;br /&gt;  ACount := ColID div 26;&lt;br /&gt;  APos := ColID mod 26;&lt;br /&gt;  if APos = 0 then&lt;br /&gt;  begin&lt;br /&gt;    ACount := ACount - 1;&lt;br /&gt;    APos := 26;&lt;br /&gt;  end;&lt;br /&gt;&lt;br /&gt;  if ACount = 0 then&lt;br /&gt;    Result := Chr(Ord('A') + ColID - 1) + IntToStr(RowID);&lt;br /&gt;&lt;br /&gt;  if ACount = 1 then&lt;br /&gt;    Result := 'A' + Chr(Ord('A') + APos - 1) + IntToStr(RowID);&lt;br /&gt;&lt;br /&gt;  if ACount &gt; 1 then&lt;br /&gt;    Result := Chr(Ord('A') + ACount - 1) + Chr(Ord('A') + APos - 1) + IntToStr(RowID);&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;// StringGrid Inhalt in Excel exportieren&lt;br /&gt;// Export StringGrid contents to Excel&lt;br /&gt;function StringGridToExcelSheet(Grid: TStringGrid; SheetName, FileName: string;&lt;br /&gt;  ShowExcel: Boolean): Boolean;&lt;br /&gt;const&lt;br /&gt;  xlWBATWorksheet = -4167;&lt;br /&gt;var&lt;br /&gt;  SheetCount, SheetColCount, SheetRowCount, BookCount: Integer;&lt;br /&gt;  XLApp, Sheet, Data: OLEVariant;&lt;br /&gt;  I, J, N, M: Integer;&lt;br /&gt;  SaveFileName: string;&lt;br /&gt;begin&lt;br /&gt;  //notwendige Sheetanzahl feststellen&lt;br /&gt;  SheetCount := (Grid.ColCount div 256) + 1;&lt;br /&gt;  if Grid.ColCount mod 256 = 0 then&lt;br /&gt;    SheetCount := SheetCount - 1;&lt;br /&gt;  //notwendige Bookanzahl feststellen&lt;br /&gt;  BookCount := (Grid.RowCount div 65536) + 1;&lt;br /&gt;  if Grid.RowCount mod 65536 = 0 then&lt;br /&gt;    BookCount := BookCount - 1;&lt;br /&gt;&lt;br /&gt;  //Create Excel-OLE Object&lt;br /&gt;  Result := False;&lt;br /&gt;  XLApp  := CreateOleObject('Excel.Application');&lt;br /&gt;  try&lt;br /&gt;    //Excelsheet anzeigen&lt;br /&gt;    if ShowExcel = False then&lt;br /&gt;      XLApp.Visible := False&lt;br /&gt;    else&lt;br /&gt;      XLApp.Visible := True;&lt;br /&gt;    //Workbook hinzufügen&lt;br /&gt;    for M := 1 to BookCount do&lt;br /&gt;    begin&lt;br /&gt;      XLApp.Workbooks.Add(xlWBATWorksheet);&lt;br /&gt;      //Sheets anlegen&lt;br /&gt;      for N := 1 to SheetCount - 1 do&lt;br /&gt;      begin&lt;br /&gt;        XLApp.Worksheets.Add;&lt;br /&gt;      end;&lt;br /&gt;    end;&lt;br /&gt;    //Sheet ColAnzahl feststellen&lt;br /&gt;    if Grid.ColCount &lt;= 256 then&lt;br /&gt;      SheetColCount := Grid.ColCount&lt;br /&gt;    else&lt;br /&gt;      SheetColCount := 256;&lt;br /&gt;    //Sheet RowAnzahl feststellen&lt;br /&gt;    if Grid.RowCount &lt;= 65536 then&lt;br /&gt;      SheetRowCount := Grid.RowCount&lt;br /&gt;    else&lt;br /&gt;      SheetRowCount := 65536;&lt;br /&gt;&lt;br /&gt;    //Sheets befüllen&lt;br /&gt;    for M := 1 to BookCount do&lt;br /&gt;    begin&lt;br /&gt;      for N := 1 to SheetCount do&lt;br /&gt;      begin&lt;br /&gt;        //Daten aus Grid holen&lt;br /&gt;        Data := VarArrayCreate([1, Grid.RowCount, 1, SheetColCount], varVariant);&lt;br /&gt;        for I := 0 to SheetColCount - 1 do&lt;br /&gt;          for J := 0 to SheetRowCount - 1 do&lt;br /&gt;            if ((I + 256 * (N - 1)) &lt;= Grid.ColCount) and&lt;br /&gt;              ((J + 65536 * (M - 1)) &lt;= Grid.RowCount) then&lt;br /&gt;              Data[J + 1, I + 1] := Grid.Cells[I + 256 * (N - 1), J + 65536 * (M - 1)];&lt;br /&gt;        //-------------------------&lt;br /&gt;        XLApp.Worksheets[N].Select;&lt;br /&gt;        XLApp.Workbooks[M].Worksheets[N].Name := SheetName + IntToStr(N);&lt;br /&gt;        //Zellen als String Formatieren&lt;br /&gt;        XLApp.Workbooks[M].Worksheets[N].Range[RefToCell(1, 1),&lt;br /&gt;          RefToCell(SheetRowCount, SheetColCount)].Select;&lt;br /&gt;        XLApp.Selection.NumberFormat := '@';&lt;br /&gt;        XLApp.Workbooks[M].Worksheets[N].Range['A1'].Select;&lt;br /&gt;        //Daten dem Excelsheet übergeben&lt;br /&gt;        Sheet := XLApp.Workbooks[M].WorkSheets[N];&lt;br /&gt;        Sheet.Range[RefToCell(1, 1), RefToCell(SheetRowCount, SheetColCount)].Value :=&lt;br /&gt;          Data;&lt;br /&gt;      end;&lt;br /&gt;    end;&lt;br /&gt;    //Save Excel Worksheet&lt;br /&gt;    try&lt;br /&gt;      for M := 1 to BookCount do&lt;br /&gt;      begin&lt;br /&gt;        SaveFileName := Copy(FileName, 1,Pos('.', FileName) - 1) + IntToStr(M) +&lt;br /&gt;          Copy(FileName, Pos('.', FileName),&lt;br /&gt;          Length(FileName) - Pos('.', FileName) + 1);&lt;br /&gt;        XLApp.Workbooks[M].SaveAs(SaveFileName);&lt;br /&gt;      end;&lt;br /&gt;      Result := True;&lt;br /&gt;    except&lt;br /&gt;      // Error ?&lt;br /&gt;    end;&lt;br /&gt;  finally&lt;br /&gt;    //Excel Beenden&lt;br /&gt;    if (not VarIsEmpty(XLApp)) and (ShowExcel = False) then&lt;br /&gt;    begin&lt;br /&gt;      XLApp.DisplayAlerts := False;&lt;br /&gt;      XLApp.Quit;&lt;br /&gt;      XLAPP := Unassigned;&lt;br /&gt;      Sheet := Unassigned;&lt;br /&gt;    end;&lt;br /&gt;  end;&lt;br /&gt;end;&lt;br /&gt;&lt;br /&gt;//Example&lt;br /&gt;procedure TForm1.Button1Click(Sender: TObject);&lt;br /&gt;begin&lt;br /&gt;  //StringGrid inhalt in Excel exportieren&lt;br /&gt;  //Grid : stringGrid, SheetName : stringgrid Print, Pfad : c:\Test\ExcelFile.xls, Excelsheet anzeigen&lt;br /&gt;  StringGridToExcelSheet(StringGrid, 'Stringgrid Print', 'c:\Test\ExcelFile.xls', True);&lt;br /&gt;end;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-3336838923000556140?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/3336838923000556140/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=3336838923000556140' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/3336838923000556140'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/3336838923000556140'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/02/export-stringgrid-to-excel-file-way-one.html' title='Export StringGrid to An Excel File (way one)'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-657334141637780777.post-2447876077668552570</id><published>2007-02-24T10:49:00.002+07:00</published><updated>2007-02-24T11:16:18.921+07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Delphi'/><title type='text'>10 of Most Delphi Used Function</title><content type='html'>Here is 10 functions mostly used &lt;br /&gt;&lt;br /&gt;procedure TForm1.Button1Click(Sender: TObject);&lt;br /&gt;var&lt;br /&gt;    S: String;&lt;br /&gt;begin&lt;br /&gt;    { 1 }&lt;br /&gt;    S := Copy('Delphi Rulezz', 5, 6); { Reads the text }&lt;br /&gt;    ShowMessage(S);&lt;br /&gt;    { 2 }&lt;br /&gt;    S := Concat('1 ',' Two, ','3'); { Connects the text }&lt;br /&gt;    ShowMessage(S);&lt;br /&gt;    { 3 }&lt;br /&gt;    ShowMessage('Length: '+IntToStr(Length('Good'))); { Shows the length of the&lt;br /&gt;                                                   string in numbers [integer] }&lt;br /&gt;    { 4 }&lt;br /&gt;    S := 'The Example'; {Deletes the text }&lt;br /&gt;    Delete(S, 8, 7);&lt;br /&gt;    ShowMessage(S);&lt;br /&gt;    { 5 }&lt;br /&gt;    S := 'Ralph is a dog';&lt;br /&gt;    Insert('good ', S, 12); { Inserts the text }&lt;br /&gt;    ShowMessage(S);&lt;br /&gt;    { 6 }&lt;br /&gt;    S := 'Delphi';&lt;br /&gt;    ShowMessage(UpperCase(S)); { Converts the text to upper case }&lt;br /&gt;    { 7 }&lt;br /&gt;    S := 'Delphi';&lt;br /&gt;    ShowMessage(LowerCase(S)); { Converts the text to lower case }&lt;br /&gt;    { 8 }&lt;br /&gt;    S := 'Delphi';&lt;br /&gt;    ShowMessage('''P'' in ''Delphi'' is:'+IntToStr(Pos('p',S))+'th'); { Gets&lt;br /&gt;                                      the position of the string in the string }&lt;br /&gt;    { 9 }&lt;br /&gt;    S := 'a1, a2, a3, a4, a5.';&lt;br /&gt;    ShowMessage('a change to b: ' + StringReplace(S, 'a', 'b', [rfReplaceAll]));&lt;br /&gt;                                        { Changes the text from one to another }&lt;br /&gt;    { 10 }&lt;br /&gt;    S := 'This   text:goes      lower.';&lt;br /&gt;    S := WrapText(S, #13#10, [':'], 12);&lt;br /&gt;    ShowMessage(S); { Moves the text lower }&lt;br /&gt;end;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/657334141637780777-2447876077668552570?l=codeprogrammer.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://codeprogrammer.blogspot.com/feeds/2447876077668552570/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=657334141637780777&amp;postID=2447876077668552570' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/2447876077668552570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/657334141637780777/posts/default/2447876077668552570'/><link rel='alternate' type='text/html' href='http://codeprogrammer.blogspot.com/2007/02/10-of-most-delphi-used-function_23.html' title='10 of Most Delphi Used Function'/><author><name>Jage</name><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
