Thursday, November 28, 2019

Accessing and Managing MS Excel Sheets With Delphi

Accessing and Managing MS Excel Sheets With Delphi This step-by-step guide describes how to connect to Microsoft Excel, retrieve sheet data, and enable editing of the data using the DBGrid. Youll also find a list of the most common errors that might appear in the process, plus how to deal with them. Whats Covered Below: Methods for transferring data between Excel and Delphi. How to connect to Excel with ADO  (ActiveX Data Objects) and Delphi.Creating an Excel spreadsheet editor using Delphi and ADORetrieving the data from Excel. How to reference a table (or range) in an Excel workbook.A discussion on Excel field (column) typesHow to modify Excel sheets: edit, add  and delete rows.Transferring data from a Delphi application to Excel. How to create a worksheet and fill it with custom data from an MS Access database. How to Connect to Microsoft Excel Microsoft Excel is a powerful spreadsheet calculator and data analysis tool. Since rows and columns of an Excel worksheet closely relate to the rows and columns of a database table, many developers find it appropriate to transport their data into an Excel workbook for analysis purposes; and retrieve data back to the application afterwards. The most commonly used approach to data exchange between your application and Excel is  Automation. Automation provides a way to read Excel data using the Excel Object Model to dive into the worksheet, extract its data, and display it inside a grid-like component, namely DBGrid or StringGrid. Automation gives you the greatest flexibility for locating the data in the workbook as well as the ability to format the worksheet and make various settings at run time. To transfer your data to and from Excel without Automation, you can use other methods such as: Write data into a comma-delimited text file, and let Excel parse the file into cellsTransfer data using DDE (Dynamic Data Exchange)Transfer your data to and from  a worksheet using ADO Data Transfer Using ADO Since Excel is JET OLE DB compliant, you can connect to it with Delphi using ADO (dbGO or AdoExpress) and then retrieve the worksheets data into an ADO dataset by issuing an  SQL query  (just like you would open a dataset against any database table). In this way, all the methods and features of the ADODataset object are available to process the Excel data. In other words, using the ADO components let you build an application that can use an Excel workbook as the database. Another important fact is that Excel is an out-of-process ActiveX server. ADO runs in-process  and saves the overhead of costly out-of-process calls. When you connect to Excel using ADO, you can only exchange raw data to and from a workbook. An ADO connection cannot be used for sheet formatting or implementing formulas to cells. However, if you transfer your data to a worksheet that is pre-formatted, the format is maintained. After the data is inserted from your application to Excel, you can carry out any conditional formatting using a (pre-recorded) macro in the worksheet. You can connect to Excel using ADO with the two OLE DB Providers that are a part of MDAC: Microsoft Jet OLE DB Provider or Microsoft OLE DB Provider for ODBC Drivers. Well focus on Jet OLE DB Provider, which can be used to access data in Excel workbooks through installable Indexed Sequential Access Method (ISAM) drivers. Tip: See the  Beginners Course to Delphi ADO Database Programming  if youre new to ADO. The ConnectionString Magic The ConnectionString property tells ADO how to connect to the datasource. The value used for ConnectionString consists of one or more arguments ADO uses to establish the connection. In Delphi, the TADOConnection component encapsulates the ADO connection object; it can be shared by multiple ADO dataset (TADOTable, TADOQuery, etc.) components through their Connection properties. In order to connect to Excel, a valid connection string involves only two additional  pieces of information -  the full path to the workbook and the Excel file version. A legitimate connection string could look like this: ConnectionString : ProviderMicrosoft.Jet.OLEDB.4.0;Data SourceC:\MyWorkBooks\myDataBook.xls;Extended PropertiesExcel 8.0;; When connecting to an external database format supported by the Jet, the extended properties for the connection needs to be set. In our case, when connecting to an Excel database, extended properties are used to set the Excel file version.   For an Excel95 workbook, this value is Excel 5.0 (without the quotes); use Excel 8.0 for Excel 97, Excel 2000, Excel 2002, and ExcelXP. Important:  You must use the Jet 4.0 Provider since Jet 3.5 does not support the ISAM drivers. If you set the Jet Provider to version 3.5, youll receive the Couldnt find installable ISAM error. Another Jet extended property is HDR. HDRYes means that there is a header row in the range, so the Jet will not include the first row of the selection into the dataset. If HDRNo is specified, then the provider will include the first row of the range (or named range) into the dataset. The first row in a range is considered to be the header row by default (HDRYes). Therefore, if you have column heading, you do not need to specify this value. If you do not have column headings, you need to specify HDRNo. Now that youre all set, this is the part where things become interesting since were now ready for some code. Lets see how to create a simple Excel Spreadsheet editor using Delphi and ADO. Note:  You should proceed even if you lack knowledge on ADO and Jet programming. As youll see, editing an Excel workbook is as simple as editing data from any standard database.

Sunday, November 24, 2019

Genetherapy Essays - Molecular Biology, Biotechnology, Gene Delivery

Genetherapy Essays - Molecular Biology, Biotechnology, Gene Delivery Genetherapy Gene Therapy Gene therapy is the use of genes and the techniques of genetic engineering in the treatment of a genetic disorder or chronic disease. There are many techniques of gene therapy. The two basic methods are called in vivo and ex vivo gene therapy. The in vivo method inserts genetically altered genes directly into the patient; the ex vivo method removes tissue from the patient, extracts the cells in question, and genetically alters them before returning them to the patient. The challenge of gene therapy is the development of a means to deliver the genetic material into the nuclei of the appropriate cells, so that it will be reproduced in the normal course of cell division and have a lasting effect. One technique involves removing cells from a patient, fortifying them with healthy copies of the defective gene, and reinjecting them into the patient. Another involves inserting a gene into an inactivated or nonvirulent virus and using the viruss infective capabilities to carry the desired gene into the patients cells. A liposome, a tiny fat-encased pouch that can traverse cell membranes, is also sometimes used to transport a gene into a body cell. Another approach employing liposomes, called chimeraplasty, involves the insertion of manufactured nucleic acid molecules (chimeraplasts) instead of entire genes to correct disease-causing gene mutations. Once inserted, the gene may produce an essential chemical that the patients body cannot, remove or render harm less a substance or gene causing disease, or expose certain cells, especially cancerous cells, to attack by conventional drugs. Gene therapy was first used in humans in 1990 to treat a child with adenosine deaminase deficiency (ADA), a rare hereditary immune disorder. It is hoped that gene therapy can be used to treat cancer, genetic diseases, and AIDS, but there are concerns that the immune system may attack cells treated by gene therapy, that the viral vectors could mutate and become virulent, or that altered genes might be passed to succeeding generations. In the United States, gene therapy techniques must be approved by the federal government. The Recombinant DNA Advisory Committee of the National Institutes of Health oversees gene therapy experiments. Like drugs, products must pass the requirements of the Food and Drug Administration. Gene therapy is a competitive and potentially lucrative field, and patents have been awarded for certain techniques. Bibliography J. Lyon and P. Gorner, Altered Fates: Gene Therapy and the Retooling of Human Life (1995).

Thursday, November 21, 2019

Management of Project Organization Essay Example | Topics and Well Written Essays - 500 words

Management of Project Organization - Essay Example This paper illustrates that although projects can be completed by a group of individuals, it is sometimes necessary to enlist the help of project organizations due to technical expertise. These contractors and service companies may also be able to complete the project more efficiently and at a cheaper rate, making it a competitive advantage to make use of these project organizations. In addition to reducing costs, project organizations can increase productivity and create better quality goods and services. Project organizations have a particular skill set that can be used in situations where either existing knowledge is not there in the firm or there is not enough scope to be able to complete the project without these organizations. Three examples are manufacturing businesses, construction projects, and non-IT organizations. The first one is more focused on reducing costs and increasing output. The second has a clear structure with a project manager in charge. The latter has specific IT project managers who are often left to do their own thing. In a project-oriented organization, you would expect to find flat structures with very few levels between project managers and the board. The reason is so that quick decisions can be made because the board is kept apprised of the latest happenings. This would be a little different for a services company because people would be hired in to conduct projects, and they would not be able to directly report to the board. In this instance, an extra layer would be added and this could slow down the flow of information between all the levels in the structure. Project effectiveness would be managed by comparing the initial plans with the final result. This could be done through checking the initial budget against the final cost, etc. A series of checkpoints along the way could also show how effective an organization is in managing projects, and alterations could be made depending on the progress (or lack of) that is occurring.