Programming Logic -Intermediate

Size: px
Start display at page:

Download "Programming Logic -Intermediate"

Transcription

1 Programming Logic -Intermediate Database Access Text References Data Access Concepts No book references Diagram Connected vs. Disconnected Adding a Data Source View Data in Grid View Data in Fields Creating a Select Grid Creating a New Table Adapter Concatenating SQL Fields Getting Grid Data Tying Data Table to Grid Customizing a Grid Coding Grid Search Selecting Records with a Grid Creating Detail Fields Using SQL Parameters (Retrieving One Record) Filling a Data Adapter Displaying the Record Saving Data Changes Canceling Data Changes Deleting a Record Updating the Lookup Grid Refreshing the Grid Sort Inserting New Records Dealing With Empty Fields Displaying Fields with NULL Values Saving Null Values to a Record Non-Persistent Data Changes Improving Field-Level Validation Appendix 1: Connecting VS 2005 and Access 2007 Unit 3: 1 of 37

2 Most business program applications require that the data entered by the user be saved so that it can be retrieved at a later time. VB.NET, combined with ADO.NET, provide a way to link your VB.NET applications to any kind of database to save and retrieve data entered by users. Data Access Concepts ADO.NET and the VB.NET links to it have been created to provide as much data access flexibility as possible. However, providing this flexibility requires complexity. The diagram on page 3 describes the various objects required to link a VB.NET form to a database and the relationships between those objects. We will be following the 3-Tier Architecture when building our data access applications. Use the PowerPoint for ADO concepts to supplement this lecture The following paragraphs describe the steps required to connect a VB.NET form and a database conceptually. After these concepts are clear, we ll talk about how to actually make it happen in VB.NET. To start, you must have a VB.NET form, its associated business class and some kind of database. The form does not have to have objects (textboxes, labels, etc.) on it to create database access but the sample in the diagram already has a couple of textboxes and a check box. The database can be of any type (Access, SQL Server, MySQL, Oracle, etc) Unit 3: 2 of 37

3 The first step to providing database access is to create a connection between your project and the database. Unfortunately, VB.NET doesn t know how to connect to every kind of database. The connection is made to a provider (comes with your database software). The provider translates VB.NET database commands to a format recognized by the database program. For example, Microsoft uses the Jet provider to translate commands for Microsoft Access. The connection must also be given the database file name and the path to that database. Note the connection is not actually opened at this time, the process for how to make the connection is merely described. After you ve defined the connection, VB automatically analyzes the structure of the database. Using this information, it creates a dataset class, a special kind of class used to store the structure of a database. VB will automatically create table adapters (see below) for each table in the database. Note you can save yourself some work by making sure your database design and construction are as complete as possible. On the other hand, when I create databases that will used by a VB front end, I don t include validation, captions, formatting etc. in the DATABASE design (structure). I take care of all that in VB. VB also automatically creates SQL commands for each table adapter to retrieve all the data of all the records of each table. Unit 3: 3 of 37

4 Unit 3: 4 of 37

5 Table adapter concepts A table adapter has four primary methods. These methods contain the SQL (Structured Query Language) commands required to select, insert, update and delete data from the database. You will learn how to provide SQL statements to select the data you want from a database, insert new records into the database, update existing records in the database and delete records in the database. The table adapter class includes a Fill method. Until this method is called (see below) no data is transferred from the database. The table adapter provides a medium to transfer the data from the database, but doesn t hold the data. You ll need a data table to hold the data. Data table classes for each table adapter are automatically defined by VB as part of the dataset class. All you have to do is reference them in your business class. The data table(s) get their data when you execute the Fill method of a data adapter. At this point (Fill), the connection to the database is opened, the Select command from the table adapter is sent to the database (through the provider) and the database returns the requested data. The connection is then automatically closed. (See discussion of disconnected databases below) Because the Select statement in the table adapter tells the database which fields of which tables to select, a similar structure must be created to hold the returned data You must define a data table of the correct type to hold the data retrieved by the table adapter After the data table is created, it is filled with the data received by the table adapter. The data is now available for the business class to use. The data in the data table is a copy of the data in the database. Any changes made to the data in the data table are not saved to the actual database until you tell the adapter to update the database. Unit 3: 5 of 37

6 Now that the data is available you have two choices for how to show that data in the forms textboxes, labels, etc. Write code to manually transfer it from the data table to a form object (unbound). Bind form objects to fields in a data table. This will automatically show the data in the designated field of the current record. Many forms have a combination of bound and unbound objects on them. If you choose to bind form objects to data table fields, you will need a binding for each form object and its corresponding data table field. Visual Basic can automatically create a binding object. Connected vs. Disconnected Database Access VB6 forms were connected to the databases they accessed Once the connection was made it was maintained (left open) as long as the form was running. Though multiple users still had access to the database, this type of connection can slow the database system down when many users are using it at the same time. It was possible to close a connection in VB6 programmatically, but then you d have to open it again (programmatically) when you needed to access the data again. VB.NET forms are disconnected from their databases. The data records required are transferred to the form s memory (data adapter Fill command) At this time the connection is opened, but as soon as the data has been transferred (to the data table), the connection is immediately closed. The table adapter automatically opens and closes the connection you don t need to worry about it. The application then uses the local copy of the data for any processing that needs to be done. If two users happen to be changing the same record at the same time, this can cause problems. You ll learn how to detect and overcome these problems later. For now, we ll assume that s not going to happen (because it rarely does). Disconnected forms process much faster and put a lot less strain on the database program itself. Unit 3: 6 of 37

7 Adding a Data Source For our purposes, a project will only have one data source, though the project could have many data sources (even data sources of different types) You add a data source to your project and then connect it to an existing database. Connecting to an Existing Database For best results, the database should already be located in the project folder (where the forms are). Click the Data Sources tab (next to the Solution Explorer) If it s not there, choose DataShow Data Sources Click the Add New Data Source link This link only appears if there aren t already data sources. If you already have data sources, you can add another by clicking the Add New Data Source button on the Data Sources toolbar (first on the left) In the wizard that appears, the Database icon should already be selected, so just click the Next button. If no connection string is designated: Click the New Connection button If necessary, click the Change button to designate the type of database you re connecting to (SQL Server Database File or Access Database) Copy PizzaShopOrder to Desktop Add database to project folder. Follow instructions to create a data source for the Pizza Shop Orders database Name connections and datasets appropriately conorders dsorders Click the Browse button and locate the database file Click the OK button and then the Next button If a message appears telling you the database is not part of your project, click Yes to add it to your project. If a message appears telling you the database already exists in the project, click NO do not replace it. If you click Yes, the database will corrupt itself as it copies over itself. If you wish, provide a shorter name for the connection string (con prefix) Click the check box next to Tables If there are queries defined in the database, you can create table adapters for them too. Change the dataset name (ds prefix) Click Finish Unit 3: 7 of 37

8 Viewing Data in a Form VB has made linking a dataset to form objects extremely simple. In the Data Sources window, point to the table whose data you want to view in a form. Drag the table to the form VB will automatically add a grid that displays all the records and fields in the table. Automatically adds a data binding navigator to the form to allow user to navigate through records. Though this is cool, few of my applications use this type of control to navigate through records Automatically creates a data set instantiation, a binding source, and a table adapter as well (in the components tray) Automatically adds code to Fill the table adapter on Form Load You should be able to run the application and navigate through the table records. Unfortunately, using this handy feature does not make your program conform to the 3-Tier Architecture and it makes vigorous data validation difficult. Add a new form to the project. Make the new form the start up form. Create the data grid on the form. Test. Delete all form objects. Unit 3: 8 of 37

9 Creating Detail Records (Overview) In addition to creating a data grid, you can use the table icon in the Data Sources to create individual fields for each record. To the right of the table name is a drop down arrow that provides access to a list of choices for how the table fields should be transferred to the form. Choose Details You can also choose what control is used for each field when it is displayed on the form. Click the + to the left of the table name to see the fields in the table. Each field has a dropdown that allows you to choose the type object used to represent the field on the form. Once you ve designated the object type used to represent the table and its individual fields, all you have to do (again) is drag the table onto the form. The dataset, data adapter, binding and navigator are automatically created Unless they re already there. One form only has one dataset Each field is represented by a separate object and an appropriate label. You ll probably want to rename the objects, but using this technique can save a lot of time creating objects. Though this is cool, most people don t find accessing their data this way very convenient and it doesn t meet our 3- Tier Architecture and data validation requirements. Create the detail records. Test. Set frmpizza as the start up form Creating a Select Grid (Overview) To allow my users to quickly choose the record they want to edit, I provide a select grid (my term). The select grid displays the minimal information required for a user to select a record. Behind the scenes, the grid also keeps track of the records primary keys. The key is used to locate the full record for editing. Additionally, I provide a Search text box that allows the user to quickly locate records in the select grid. Similar functionality to Auto Complete in a combo box Unit 3: 9 of 37

10 Creating a New Table Adapter Before we can create the grid, we have to create a new table adapter that will be used to fill the grid. One table adapter can be used to store numerous SQL commands, but only if the SQL commands return exactly the same field list. If you need a different list of fields, you ll need an additional table adapter Because the select grid displays a subset of a table s data (fields required to select a record), we ll need a new table adapter. Create qryorderlu table adapter: OrderID OrderDate LName, FName as Customer Sorted by OrderDate Desc, Last, First Click the Edit Dataset with Designer button on the Data Sources toolbar (2 nd button) In the Designer window, right-click in an empty area and choose AddTable Adapter The connection string should already be correct click Next Ensure Use SQL statements is selected click Next Click the Query Builder button. Select the table you re working with. Use the Query Builder to select the fields you want to include in the look up grid Include the primary key field Include the minimal number of fields required for the user to select a record Use the Sort Type column to designate how the records should be sorted Note the SQL command created by the Query Builder You can also preview the data Click the OK button Unit 3: 10 of 37

11 Creating a Concatenated Field in SQL Often, the data you want to show in the select grid will be stored in multiple fields. To give the select grid a more professional appearance, you might concatenate fields from the database into one field in the data table (displayed in the select grid). To create a concatenated field, you ll have to edit the SQL statement manually. Concatentate the last and first name fields. fieldname + ' ' + fieldname fieldname & " " & fieldname 'Not in Access 2007 In the SQL statement, you can list the fields you want included in the query after the keyword Select You can replace any keyword with a concatenation of fields Select StudentID, StudLName + ', ' + StudFName As Student From tblstudent After you ve finished customizing the SQL command, click the Next button. If you get error messages, you ll have to look over the SQL command and clear up any syntax errors. Since we want the user to be able to change the details, make sure all check boxes in the Choose Methods to Generate are checked. Click Next The Wizard will then report its results. You should see blue check marks next to all the objects. If not, repeat these steps. Click the Finish button A new table adapter will appear in the XSD window. Rename the new adapter Click the table adapter name and then edit it I normally add a prefix of qry or vw (for view another name for query) and a suffix of LU (lookup) to my lookup adapters. Close and save the XSD window You should now see both of the table adapters under the data set (Data Sources window) Unit 3: 11 of 37

12 Creating a Select Grid (continued) Next we ll add a Data Grid View control to the form. We could simply drag the new table adapter from the Data Sources window, but we ll be sticking to the 3- Tier Architecture, so that really won t help. You ll find the Data Grid View control in the Data group of the toolbox. Double-click the control to place it on the form, then roughly size it. You ll fine tune its size later. Name the grid grdselect. I use the same name for the select grid on all my forms. It makes copying code easier. Add grdselect to the left side of the form The grid will need a data table to hold the lookup records, but we don t want any data components on our GUI form We ll use a Binding Source instead and link it to a data table created by the business class. The Binding Source tool is also in the Data group of the toolbox. Double-click the control. It will appear in the components tray because it is not a visible control. Name the control appropriately using a bs prefix. Add bsorderlu to the form. Getting Data for the Grid Again, because we re using the 3-Tier Architecture any requests the GUI class has for data should go through the business class. Add a new method to the business class that will create a data table the binding source can link to Tip: Create a Data Access region in your class file to help organize your methods. Add OrderLookupTable method to the business class (in a Data Access Procedures region) #Region "Data Access" Public Shared Function OrderLookupTable() As dsorders.qryorderludatatable 'This procedure retrieves the data needed for the lookup grid. Dim ta As New dsorderstableadapters.qryorderlutableadapter Dim dt As New dsorders.qryorderludatatable ta.fill(dt) Return dt End Function #End Region Unit 3: 12 of 37

13 Public makes this method available to other classes, allowing the GUI to request the look up data Because this method is not specific to one instance of the class, it is Shared. Remember, you invoke shared methods using the class name, not an instance name. This method returns something (data table) so it should be a function (though it could be a Property) I always include LookupTable in the method name because that s what the method returns. Because this method is a function, we have to designate the type of data it returns. Because we already defined the table adapter, the data set class (ds) automatically includes another class that defines what the data table looks like (fields and types). Simply select it from the list that appears. We ll need two variables to accomplish the method s task A new table adapter of the appropriate type The table adapter listed in the dataset is only the class, defining table adapter. This variable instantiates that class. Note: the table adapters are defined in the dstableadapters class, not just the ds class We ll also need a data table variable to hold the results of the table adapter s Fill command. Note: this variable is the same type as the function s return type. Now that we have the variables, filling the data table is quite simple. We simply invoke the table adapter s Fill method, designating the results should go in our data table variable. Finally, the function returns the data table to the GUI class Unit 3: 13 of 37

14 Tying the Data Table to the Select Grid Next, we need to tie the data table received from the business class to the binding source in the GUI class and then bind the select grid to the binding source. Note: even though they both already exist, you can t bind the grid to the binding source ahead of time. It seems the binding source needs to have a data source before the grid can correctly bind to it. This is done on Form Load. To keep Form Load from becoming cluttered and because we ll be customizing the appearance of the grid later, I create a Load Grid procedure and call it from Form Load. Create procedure LoadGrid and call it from Form Load Private Sub LoadGrid() bsorderlu.datasource = JellyBeanOrder.OrderLookupTable grdselect.datasource = bsorderlu End Sub The first command invokes the data access method from the class and assigns the data table that is returned to the data source of the binding object. This links the data table to the binding source The second command sets the data source of the select grid to the binding object. This links the grid to the binding source, and therefore to the data table that contains the lookup records. Remember, the binding must be linked to the data table before the grid is linked to the binding object You should now be able to run your form and see the lookup fields for the current records in the database. Test to ensure the data displays in the grid. Look in the project Debug folder. Note the database has been copied to this folder. Unit 3: 14 of 37

15 Customizing the Data Grid View Though the grid shows the lookup records, the grid appearance is most likely not appropriate Key fields should be hidden Column widths need to adjusted Column headers need spacing User should not be allowed to change the grid s appearance or change data in the grid directly. We can t do any of this customizing ahead of time because the grid doesn t know what columns it will be displaying until the program is running. I include this customization code in Load Grid, because it only needs to be done once at Form Load. First, we ll prevent the user from changing the appearance of the grid and from changing the data in the grid directly grdselect.readonly = True Prevents the user from changing the data in grid directly. grdselect.rowheadersvisible = False By default, the grid includes a selection box (row header) to the left of each row in the grid. We ll have the users select rows by clicking anywhere in the row. We ll remove the selection boxes to save a little space grdselect.allowusertoresizerows=false If the user is trying to click on a cell and accidentally clicks and drags the row border, the row size of course changes. Most of my users find this very disconcerting (especially when they can t restore the original size), so I turn this feature off. grdselect.allowusertoaddrows=false Power users might right-click the grid and try to add new rows and data to the grid. That s not how our user interface works, so we ll prevent the user from adding rows to the grid. grdselect.allowusertodeleterows=false Again, power users might right-click a row and attempt to delete the grid row anticipating the actual data will be deleted with it. This won t work (because the grid only contains lookup data), so we ll prevent the user from doing this. grdselect.multiselect=false If the user drags when selecting a row in the grid, they may highlight multiple rows. We only want one row selected at time. Make the grid Set the 6 properties described in the notes. Unit 3: 15 of 37

16 The remaining customization is done by accessing the Columns collection of the grid Each column of the grid is given an index (0-based), but it s much more self-documenting to refer to the columns by name. grdselect.columns("fieldname").property = FieldName must match one of the fields in the lookup table adapter (from the table) The following are the properties you ll most likely use to customize columns.visible = False Used for the key column so the user doesn t need to look at it Columns are visible by default Invisible columns normally don t include any other customization..headertext = column header Defines what text should appear at the top of the column Default is field name Use to add spaces between words for a more professional appearance.width = value Defines how many pixels wide a column will be. Default = 100 Adjust until data in the column appears appropriately. Hide the ID column Customer: Width 150 Unit 3: 16 of 37

17 .DefaultCellStyle = colstyle Allows you to format data in the column. Normally used for dates Before you can assign a style to a column, you first have to define it. Date: yyyy-mm-dd Width 85 Align right Header: Order Date Dim colstyle As New DataGridViewCellStyle Now you can use dot notation to access all kinds of style properties. colstyle.format = "yyyy-mm-dd" colstyle.alignment = pick from list And finally, apply that style to the column grdselect.columns("orderdate").defaultcellstyle = colstyle Apply the appropriate column properties to each column in the grid each field in the lookup table adapter. Once you ve defined all the column widths, add up the visible column widths and add extra for the scroll bar. 20 pixels seems to be the right width Manually enter the total in the Width property of the grid to make the grid just the right size for the column widths you defined. If you modify the size of a column you ll have to adjust the width of the grid manually again. The final step is to select the first cell in the grid. When you link the binding source to a grid at runtime, the first cell is not automatically selected. We ll need the first cell to be selected later Set the width of the grid to 255 ( ) grdselect.currentcell = grdselect.firstdisplayedcell Your grid is now ready to use. Select the first cell in the grid Unit 3: 17 of 37

18 Coding the Search Textbox Before we link the grid to the data fields, let s include the code that allows the user to search the list of orders Actually, our code will filter the records, hiding records that don t match the user s criteria, but most users don t understand the word filter. This filtering capability is the primary reason I include a binding source in my project it makes filtering extremely easy. It is possible to bind the grid directly to the data table, but then filtering wouldn t be available. The following code goes in the txtsearch box s TextChanged event Every time the user changes just one letter, the grid is refiltered. Add txtsearch to the form (with label) Code txtsearch.textchanged Dim filter As String = txtsearch.text.replace("'", "''") bsselect.filter = "Customer Like '*" & filter & "*'" 'grdselect_click(sender, e) The first command defines a filter variable that is defined as the current contents of the txtsearch box, but with each apostrophe doubled. Note the second command uses apostrophes in the filter criteria. If there is an apostrophe in the text box, it messes up the filter. Doubling each apostrophe solves the problem. The second command sets the Filter property of the binding (to which the grid is linked) to only display records that contain the text that s in the txtsearch box. The Like and * are SQL commands All you have to do in this command is change the name of the field to be used for filtering (Customer) The third command calls the grdselect_click function After filtering, the row we were on may no longer be displaying. This will display the details of the first record in the grid. grdselect_click requires two parameters. Sender and e serve as dummy parameters (just to make grdselect_click happy) Test Test O Connor Unit 3: 18 of 37

19 Using the Grid to Select Records Now, we need a method to sense when the user clicks in a grid row so we can show all the details of the matching record. The grid Click event provides the easiest way to sense that the user has selected a new row. In the Click event, you can determine what the current row is (row with the cursor in it) Code grdselect_click grdselect.currentrow Now, we ll want to collect the data in the ID field. We ll use this to locate the corresponding record in the database The CurrentRow object includes a collection of cells Again, you could designate the column s index number (0-based) but using the field name is much more self-documenting grdselect.currentrow.cells("orderid") Finally, you ll want to extract the Value of that cell The Value property is an Object, so you ll have to convert it to the proper type. CInt(grdSelect.CurrentRow.Cells("OrderID").Value) Unit 3: 19 of 37

20 One special situation we ll have to handle in grdselect_click is the situation where there are no records in the grid. This happens if the grid is filtered (only show orders for Andy Thompson). There may not be any records that match the filter If you try to fill the table adapter with an empty key field (OrderID) it will crash. A simple If statement will solve the problem. The If statement simply checks the current row property of the grid to see if it is Nothing (a VB keyword). If it is not nothing, there is a record to be displayed. Though no records are in the grid (and the program doesn t crash) the last record is still displayed in the details section of the form. You could simply clear all the fields. In the next unit, you ll learn an easier way to deal with this. If grdselect.currentrow IsNot Nothing Then Dim oid As Integer 'Selected Order ID Add an IF statement checking to see if there is a current row Comment out GetRecord and DisplayRecord. Add breakpoint to Try Run. Check oid When it works, restore the call to grdselect_click in txtsearch oid = CInt(grdSelect.CurrentRow.Cells( OrderID ).Value) Try currrecord.getrecord(oid) DisplayRecord() Catch MessageBox.Show( Errors in database fields ) End Try End If Creating the Detail Fields In the Data Sources window, click (once) the table you re using to display details A drop down arrow will appear This arrow allows you to control how the table is rendered when you drag it to the form The default is Data Grid View Choose Details Drag the icon in front of the table to the form Optional. Form fields in example already exist. Unit 3: 20 of 37

21 For each field in the table, VB will create an object to display the data and a label for each object The type of object is based on the type of data in the database table. Most appear as text boxes. You can change the type by expanding the table so you can see the fields, then selecting the field, then changing (using the dropdown) the field object type. Delete the old object on the form, then drag the new version of the field to the form. Note the field labels have appropriate spaces inserted. VB also creates a new Binding Source and a new table adapter in the components tray. Each object is bound to the table using the Binding Source Click any object. Expand the object s (DataBindings) property. Since we don t want our details bound to the database, we need to disconnect the fields from the table. The easiest way to do this is to delete the Binding Source Make sure you delete the right one. We DO want to keep the binding source for the data grid. Retrieving Only One Record When the user clicks on a record in the grid we want to display the entire corresponding record. Since we can only display one record at a time, we only need to retrieve one record at a time To limit the records retrieved, we need to change the SQL for tblorders to only retrieve the record whose OrderID matches the OrderID of the selected row in the grid. Dataset Design view Right-click the table and choose Configure Update the class: Add _OrderID (integer) Add OrderID property READONLY Unit 3: 21 of 37

22 To retrieve only one record, add a parameter to the SQL statement Select * From tblname Where OrderID =? OrderID represents the primary key field name in the table? is a parameter that must be filled in when the data adapter is filled. If there is more than one parameter, each gets its own? In SQL Server, parameters are each given names that must begin I also like to rename the Fill method to FillByID to designate that only one record is being retrieved. Because the GUI shouldn t access the data class directly, it will send the data request to the business class. We ll have to add a GetRecord method to the business class. This method will get one record s data (the record chosen in the grid) from the database and copy the values into its data members. The GUI can then copy the data to the form fields using the business class properties. GetRecord must include one parameter the ID number of the record we want to retrieve Public Sub GetRecord (ByVal OrderID As Integer) Just like the GetLookupTable method we wrote, the GetRecord method must instantiate a table adapter and then a data table to hold the record retrieved from the database. The only difference is the type of data table (from the main table adapter, not the lookup). Additionally, to simplify the transfer of data from the data table to the business class members, we ll define a variable that holds one row from the data table. Update tblorders SQL Write GetRecord Declare ta, dt, dr Dim ta As New dsorders.tblorderstableadapter 'No LU Dim dt As New dsorders.tblordersdatatable Dim dr As dsorders.tblordersrow 'No New Unit 3: 22 of 37

23 Now we re ready to use the table adapter to fill the data table. ta.fillbyid(dt, OrderID) This command is similar to the command we used to fill the lookup table The new method name is used: FillByID After the data table, the ID number we want is included. Because the SQL in the FillByID method includes a parameter, you must include the parameter in the Fill command. At this point, the data table (dt) contains the record we want No validation is required. The ID number came from the grid that was filled from this same table, so it must exist. There will never be more than one record. Since this is a primary key field, duplicates can t exist. Next we ll make our data row pointer (dr) point to the first (and only) row in the data table The data table has a Rows property that provides access to all the rows in the data table. These rows are indexed. However, we know there s only one row. dr = CType(dt.Rows(0), dsorders.tblordersrow) Because the rows of the data table are generic rows, we need to manually convert them to the appropriate type (same type as dr) Next, we have to extract the data from the data row and transfer it to the business class members. To simplify coding, we ll use a with statement Because dr is strongly typed, it includes the field names and their data types in the class. With dr _orderid =.OrderID OrderDate =.OrderDate CustomerFirstName =.CustFirstName etc. End With Fill the data table Define dr Extract the field information Test GetRecord using breakpoint in grdselect_click Unit 3: 23 of 37

24 Displaying the Record Now, the business class (actually, the currrecord instantiation) contains the record we want to display, but we need to transfer the field data to the form objects To do this, we ll create a custom procedure I call it DisplayRecord Remove comment from DisplayRecord in grdselect_click Create procedure DisplayRecord Private Sub DisplayRecord() End Sub Private designates this procedure can only be called from other procedures in this form Sub is short for subroutine. Subroutines perform a procedure then return to the calling procedure Functions perform a procedure and return a value to the calling procedure DisplayRecord is the name of the procedure VB will automatically add the ( ) End Sub designates the end of the subroutine VB enters this line automatically when you press Enter after the procedure name TIP: Before entering the subroutine header, place your cursor in the appropriate spot so the subroutine appears in the correct alphabetical location. Unit 3: 24 of 37

25 DisplayRecord transfers the data from the fields in currrecord to the form objects With currrecord txtname.text =.StringFieldName dtpdate.value =.DateField txtnumber.text =.NumericField.ToString chkbox.checked =.BooleanField End With To simplify the code, we surround the transfer commands with a With statement Text fields can be directly transferred to a Text Box or Label Text field Text fields could also be directly transferred to the Text property of a Combo Box or List Box Date fields can be directly transferred to a Date Picker Value field Yes/No fields can be directly transferred to a Check Box Checked property. Numeric fields must be converted to strings (and probably formatted) before transferring them to a Text Box Use a Select statement to figure out which Radio Button to select if a field is represented by Radio Buttons on the form. Finally, we need to call DisplayRecord in the grid Click event, after filling the data table. Transfer the order fields to their form components. Test the program Filter for Gaul Note immediately displays record Test Click the grid at the end of Form Load Saving Data Changes At this point, the user can change any data field they wish However, since the form objects are not bound to the data table, the changes are not automatically made to the database, only the values displayed on the form We ll have to transfer the changes made to the form fields to the database, via the business class. Unit 3: 25 of 37

26 Remember, for all the data requests made by the form there will be a component in the data class and the business class that correlate to that request. Normally, you create the data component, then the business component, then the form component. To save, we ll need an SQL statement in the table adapter that saves (updates) the values in the database. Edit the Dataset Since we want to update all the fields (even if some of them didn t change), we ll add an SQL command to the main table adapter Right-click the title bar of the table adapter for this table (not the lookup adapter). Choose AddQuery Use SQL statements, Next Select the Update option. The wizard will automatically generate the SQL to update the table, but it puts a lot of extra code in there. Locate the word WHERE Click before the first word AND that follows WHERE and delete all the text that follows Remove all the parenthesis after WHERE To use this SQL command, you will have to provide the new values for all the fields in the table (note all the?) and the ID of the record to be changed. Click Next. Change the name of the query if you wish, then click Next. If Generate UPDATE statement does not appear with a blue check mark next to, return to the SQL and attempt to locate the error. Alternatively, you could just rebuild the entire UPDATE query. Click Finish. Next, we ll have to add a method to the business class to execute this SQL. Remember, we created a SaveRecord method in the Validating unit that checked to ensure all the data was valid and then simply displayed a message designating that the save would have occurred. Now it s time to replace the placeholder with the actual code. Move SaveRecord into data access region Unit 3: 26 of 37

27 Because updating does not retrieve any data, we won t need a data table instantiation for this process. We will need a table adapter instantiation for the main table adapter (not the lookup) so we can execute the Update command. Instantiate the adapter as we have done before. Next, we ll issue the command to save the changes. Remember, all our Validating events in the GUI class have already transferred the data changes to the business class. Create an update query ta.updateorder(_orderdate, _cfirstname, _clastname, flavor, _size, _quantity, CDec(_price), _ CDec(_discount), _express, orderid) Remember the Update SQL we wrote included parameters (?) for each field, so we have to provide the fields values in the correct order (VB Intellisense will show you which order) Note the double fields needed to be converted to the Decimal type. This is because the VB double type does not correlate exactly to the Access double or currency types. The last parameter in the Update command is the order ID. Obviously, we are not going to be updating the order ID field (its auto-number). This parameter is used by the Update command to determine which record in the database should be updated. In the Save button Click event, we need to first check to ensure there are no errors left on the form (NoErrors method) If there are no errors, all that needs to be done is call the Save Data method for the class instance. Add the Update command to the code Note: Validation already in class & GUI Change a record, save it. Unit 3: 27 of 37

28 Canceling Data Changes The user may wish to cancel changes made to the form data Note this must be done BEFORE the Save button is clicked. Unfortunately, the original data in the business class has already been changed (to reflect the changes on the form), so we ll have to go back to the database (which still contains the unchanged data). The easiest way to do this is simply call grdselect_click Code btncancel.click Call grdselect Clear error markers Test (error markers too) grdselect_click(me, e) A call to grd_select_click requires two parameters (sender and event arguments). We aren t really calling from a sender so we ll simply use Me and e to fulfill the requirement. Calling grdselect_click retrieves the data from the data class into the business class (returning the business class members to the original values) and calls DisplayRecord to show the original values on the form as well. You ll also want to clear all the error markers that the user s changes may have caused You might want to add verification before canceling the user s changes Deleting a Record To delete a record, we ll again have to create the appropriate SQL, execute it from the business class and call that business class method from the GUI class. Unit 3: 28 of 37

29 The SQL to delete a record from the database is quite straightforward. Edit the Dataset Since we want to delete all the fields, we ll add an SQL command to the main table adapter Right-click the title bar of the table adapter for this table (not the lookup adapter). Choose AddQuery Use SQL statements, Next Choose the Delete option, Next The wizard will automatically generate the SQL to delete the record, but it puts a lot of extra code in there. Locate the word WHERE Click before the first word AND that follows WHERE and delete all the text that follows Remove all the parenthesis after WHERE To use this SQL command, you will have to provide one parameter the ID number of the record to be deleted. Click Next. Change the name of the query if you wish, then click Next. If Generate DELETE statement does not appear with a blue check mark next to, return to the SQL and attempt to locate the error. Alternatively, you could just rebuild the entire DELETE query. Click Finish. Next, we ll create the method in the business class that executes this query. Again, no data is returned so we don t need a data table, but we do need a table adapter instance to execute the delete command. All that remains to execute the SQL to delete the current record, providing the current ID number ta.deleteorder(_orderid) Finally, we ll call the Delete method from the GUI class Since deleting data is rarely a good idea, the GUI will also prompt the user to verify the record should actually be deleted. Add the Delete query to the table adapter. Code DeleteRecord (class) Create the table adapter instance. Execute the query. Code btndelete In the prompt, make the No button the default. Unit 3: 29 of 37

30 Updating the Lookup Grid If the user changes a field that is displayed in the grid or the user deletes a record, the grid data will be out of date Remember, the grid is based on a lookup table (local copy of data) so it won t automatically reflect changes to the database table We could simply refill the table adapter for the lookup, but if there are many records, this could take some time. Instead, we ll simply update our local copy of the data. We ll deal with this in btnsave_click and btndelete_click If the user changes a value that is displayed in the grid (Order Date or Customer in the example), the grid doesn t automatically update. When we save the records, we ll copy the values that appear on the form back to the grid. Change a customer s first or last name. Save the changes. Note the grid doesn t update. Add code to btnsave to update the current row of the grid. Set Readonly to false for customername Test by changing first name, last name and order date (one at a time). Note if you scroll, the changes are remembered. grdselect.currentrow.cells("customername").value = _ txtfield.text Because the grid and table adapter are bound, any changes we make to the grid will be applied to the table adapter. BIG IMPORTANT NOTE. If a field in your select grid is a calculated field, you must tell the table adapter to allow changes to the field. By default, the field is read only. Open the Data Sources Dataset Designer. Click the calculated field in the table adapter. Change the field s Read Only property to False Unit 3: 30 of 37

31 If the user deletes a record, we ll have to remove it from the grid. When the field is removed from the grid, it is also removed from the data table grdselect.rows.remove _ (grdselect.currentrow) grdselect_click(new Object, _ New System.EventArgs) The first command removes a row from the grid Remove needs to know which row to remove. We send in the current row. Now that a row from the grid has been removed, we need to simulate a click to the grid (call grdselect_click) to display the details of the new record. Note if there are no more records (deleted the last one), grdselect_click handles it. Add code to btndelete to remove the record from the grid. Note what happens if the grid is empty (filter for Aikman, delete) OK for now. Refreshing the Grid Sort Order If the user changes data that will cause a change to the grid, the grid data may now be out of order. To refresh (or resort) the grid, you first have to make the changes permanent in the lookup data table which we access through the binding After saving the changes, resort the grid. bindname.endedit() The key to resorting the data in the grid is not to resort the grid, but to sort the binding the grid is bound to. You can sort the grid, but that only works if you're sorting by one column This technique allows you sort by one column or multiple columns. bindname.sort = "Field1, Field2, Field3 DESC" The field names and DESC (sort descending) are NOT case sensitive. Unit 3: 31 of 37

32 Unfortunately, now that the data is resorted the record we were working on is probably in a different position. The form detail continues to display the current record, but the selected record in the grid isn t correct. Because of the binding context, this is also a quick fix. bindname.position = bindname.find("orderid", currrecord.orderid) This command uses the Find method of the binding source to find a record. The first parameter designates which field to look in The second parameter designates the value to find. In this case, the OrderID of currrecord The Find method returns the index of the record. When the record is found, we assign its index to the Position property of the binding source, making it the current record and, as a side effect, highlighting it in the grid. Highlight the current record in the grid. Test Inserting New Records Inserting records requires some advanced processing we ll learn how to do this in the next unit. For now, add records to the database directly Dealing With Empty Fields Most tables will allow you to leave some of the fields in a table blank. This can cause problems and if you don t deal with it properly could waste database space. Empty fields in the database are generally stored as NULL. Null is NOT the same as the empty string "". NULL is basically nothing, whereas the empty string is a string (there s overhead involved in that) that doesn t have any characters. As you already know, VB textboxes and CInt, CDbl, don t handle NULL values very well (crash) You might consider storing all empty textboxes as empty strings in the database (to avoid the crash problem), but this doesn t work very well for numeric values. Additionally, empty strings take up more room in the database than NULL values. Luckily, VB and table adapters, make dealing with NULL values easy. See Jeffrey Pearl, 1/23/2009 Unit 3: 32 of 37

33 Displaying Fields with NULL Values If a database field stores a NULL value and you try to transfer the null value to a business class member, your program will crash (an exception is thrown) The table row includes a method that allows you to check to see if a field is NULL before you try to transfer it to the member. If Not dr.isfieldnamenull Then Transfer field data to form object Else Set text field to empty string Set numeric field to null value End If Check for NULL values in: Soda Cheese Sticks Coupon In GetRecord Normally, the fields that can be NULL are displayed using Text Boxes. Date Pickers MUST have a date, but you can add a Check Box to the Date Picker and turn that off to represent a missing date. List Boxes and Combo Boxes can handle empty strings Yes/No fields and their corresponding Check Boxes always have either a True or False value. You ll have to write code to deal with Radio Buttons when no value is provided (uncheck them all). Note I check for NOT NULL in the If statement. That s just a personal thing I prefer to check for the most likely condition. This processing only needs to be done for fields that are not required. The DisplayRecord procedure in the GUI class will have to recognize when the numeric fields in the business class contain NULL values (business constant). Use an If statement to check for the NULL values. When the NULL value exists, clear the text box. You don t need to worry about text fields; they can handle the empty string. In DisplayRecord Test for Jeffrey Pearl Unit 3: 33 of 37

34 Saving NULL Values to a Record When you re saving records, you ll need to sense which fields have been left blank. When a field is blank, you should set the database table field to NULL instead of transferring an empty string to the field. We need to add processing to the business class Save Data method to ensure NULL values are stored in the database. We ll create a temporary variable for every field that could potentially NULL. We ll then determine whether to copy the member value to that field or set it to NULL. Check for empty fields in SaveRecord Test Dim ntextfield As String = Nothing n for Nullable Dim nnumberfield As Nullable(Of Decimal) = Nothing If _textmember <> "" Then ntextfield = _textmember If _numericmember <> NULLVALUE Then nnumericfield = _numericmember Again, I check for NOT NULL because that s what I expect to occur most often (personal preference). Because of validation, the business class does not allow the GUI class to put NULL values into business class members. We ll need a mechanism that allows the GUI class to tell the business to make the member NULL. Again, this should only be necessary for numeric fields that can be left blank. Transfer the NULL constant you defined in the business Unit 3: 34 of 37

35 Non-Persistent Data Changes While you re running the program, the changes you make to records are persistent they stick. However, when you exit the program and run the program again, the original records appear again. THIS IS NORMAL (it s a feature) When you create a database connection, the database itself is stored in the project folder (one level in from the.sln file) However, when you run the program, the database needs to be in the same folder as the executable. VB copies the database from the project folder to the Debug folder every time you execute the program. If you click the database file in the SOLUTION EXPLORER, you ll get access to the database Copy to Output Directory property. By default this property is set to Copy Always. This is the property that causes VB to create a copy of the database every time you run the program. Check it out, but don t change it. Note there is an.accdb file in the project folder and in the Debug folder. Unit 3: 35 of 37

How to use data sources with databases (part 1)

How to use data sources with databases (part 1) Chapter 14 How to use data sources with databases (part 1) 423 14 How to use data sources with databases (part 1) Visual Studio 2005 makes it easier than ever to generate Windows forms that work with data

More information

Access Intermediate

Access Intermediate Access 2013 - Intermediate 103-134 Advanced Queries Quick Links Overview Pages AC124 AC125 Selecting Fields Pages AC125 AC128 AC129 AC131 AC238 Sorting Results Pages AC131 AC136 Specifying Criteria Pages

More information

Access Intermediate

Access Intermediate Access 2010 - Intermediate 103-134 Advanced Queries Quick Links Overview Pages AC116 AC117 Selecting Fields Pages AC118 AC119 AC122 Sorting Results Pages AC125 AC126 Specifying Criteria Pages AC132 AC134

More information

ADO.NET 2.0. database programming with

ADO.NET 2.0. database programming with TRAINING & REFERENCE murach s ADO.NET 2.0 database programming with (Chapter 3) VB 2005 Thanks for downloading this chapter from Murach s ADO.NET 2.0 Database Programming with VB 2005. We hope it will

More information

Visual Basic 2008 Anne Boehm

Visual Basic 2008 Anne Boehm TRAINING & REFERENCE murach s Visual Basic 2008 Anne Boehm (Chapter 3) Thanks for downloading this chapter from Murach s Visual Basic 2008. We hope it will show you how easy it is to learn from any Murach

More information

Access Intermediate

Access Intermediate Access 2010 - Intermediate (103-134) Building Access Databases Notes Quick Links Building Databases Pages AC52 AC56 AC91 AC93 Building Access Tables Pages AC59 AC67 Field Types Pages AC54 AC56 AC267 AC270

More information

Chapter 3. Windows Database Applications The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill

Chapter 3. Windows Database Applications The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill Chapter 3 Windows Database Applications McGraw-Hill 2010 The McGraw-Hill Companies, Inc. All rights reserved. Objectives - 1 Retrieve and display data from a SQL Server database on Windows forms Use the

More information

ICDL & OOo BASE. Module Five. Databases

ICDL & OOo BASE. Module Five. Databases ICDL & OOo BASE Module Five Databases BASE Module Goals taken from the Module 5 ICDL Syllabus Module 5 Database requires the candidate to understand some of the main concepts of databases and demonstrates

More information

Microsoft Access 2010

Microsoft Access 2010 2013\2014 Microsoft Access 2010 Tamer Farkouh M i c r o s o f t A c c e s s 2 0 1 0 P a g e 1 Definitions Microsoft Access 2010 What is a database? A database is defined as an organized collection of data

More information

SharePoint Designer Advanced

SharePoint Designer Advanced SharePoint Designer Advanced SharePoint Designer Advanced (1:00) Thank you for having me here today. As mentioned, my name is Susan Hernandez, and I work at Applied Knowledge Group (http://www.akgroup.com).

More information

Word: Print Address Labels Using Mail Merge

Word: Print Address Labels Using Mail Merge Word: Print Address Labels Using Mail Merge No Typing! The Quick and Easy Way to Print Sheets of Address Labels Here at PC Knowledge for Seniors we re often asked how to print sticky address labels in

More information

John W. Jacobs Technology Center 450 Exton Square Parkway Exton, PA Introduction to

John W. Jacobs Technology Center 450 Exton Square Parkway Exton, PA Introduction to John W. Jacobs Technology Center 450 Exton Square Parkway Exton, PA 19341 610.280.2666 ccljtc@ccls.org Introduction to Microsoft Access 2007 Introduction to Microsoft Access What is Microsoft Access? Access

More information

EXCEL 2003 DISCLAIMER:

EXCEL 2003 DISCLAIMER: EXCEL 2003 DISCLAIMER: This reference guide is meant for experienced Microsoft Excel users. It provides a list of quick tips and shortcuts for familiar features. This guide does NOT replace training or

More information

SPARK. User Manual Ver ITLAQ Technologies

SPARK. User Manual Ver ITLAQ Technologies SPARK Forms Builder for Office 365 User Manual Ver. 3.5.50.102 0 ITLAQ Technologies www.itlaq.com Table of Contents 1 The Form Designer Workspace... 3 1.1 Form Toolbox... 3 1.1.1 Hiding/ Unhiding/ Minimizing

More information

-Using Excel- *The columns are marked by letters, the rows by numbers. For example, A1 designates row A, column 1.

-Using Excel- *The columns are marked by letters, the rows by numbers. For example, A1 designates row A, column 1. -Using Excel- Note: The version of Excel that you are using might vary slightly from this handout. This is for Office 2004 (Mac). If you are using a different version, while things may look slightly different,

More information

Using Microsoft Access

Using Microsoft Access Using Microsoft Access USING MICROSOFT ACCESS 1 Interfaces 2 Basic Macros 2 Exercise 1. Creating a Test Macro 2 Exercise 2. Creating a Macro with Multiple Steps 3 Exercise 3. Using Sub Macros 5 Expressions

More information

Chapter 4: Single Table Form Lab

Chapter 4: Single Table Form Lab Chapter 4: Single Table Form Lab Learning Objectives This chapter provides practice with creating forms for individual tables in Access 2003. After this chapter, you should have acquired the knowledge

More information

COPYRIGHTED MATERIAL. Visual Basic: The Language. Part 1

COPYRIGHTED MATERIAL. Visual Basic: The Language. Part 1 Part 1 Visual Basic: The Language Chapter 1: Getting Started with Visual Basic 2010 Chapter 2: Handling Data Chapter 3: Visual Basic Programming Essentials COPYRIGHTED MATERIAL Chapter 1 Getting Started

More information

Your First Windows Form

Your First Windows Form Your First Windows Form From now on, we re going to be creating Windows Forms Applications, rather than Console Applications. Windows Forms Applications make use of something called a Form. The Form is

More information

Intro. Scheme Basics. scm> 5 5. scm>

Intro. Scheme Basics. scm> 5 5. scm> Intro Let s take some time to talk about LISP. It stands for LISt Processing a way of coding using only lists! It sounds pretty radical, and it is. There are lots of cool things to know about LISP; if

More information

Objective 1: Familiarize yourself with basic database terms and definitions. Objective 2: Familiarize yourself with the Access environment.

Objective 1: Familiarize yourself with basic database terms and definitions. Objective 2: Familiarize yourself with the Access environment. Beginning Access 2007 Objective 1: Familiarize yourself with basic database terms and definitions. What is a Database? A Database is simply defined as a collection of related groups of information. Things

More information

Section 1. How to use Brackets to develop JavaScript applications

Section 1. How to use Brackets to develop JavaScript applications Section 1 How to use Brackets to develop JavaScript applications This document is a free download from Murach books. It is especially designed for people who are using Murach s JavaScript and jquery, because

More information

FILE ORGANIZATION. GETTING STARTED PAGE 02 Prerequisites What You Will Learn

FILE ORGANIZATION. GETTING STARTED PAGE 02 Prerequisites What You Will Learn FILE ORGANIZATION GETTING STARTED PAGE 02 Prerequisites What You Will Learn PRINCIPLES OF FILE ORGANIZATION PAGE 03 Organization Trees Creating Categories FILES AND FOLDERS PAGE 05 Creating Folders Saving

More information

Creating Reports in Access 2007 Table of Contents GUIDE TO DESIGNING REPORTS... 3 DECIDE HOW TO LAY OUT YOUR REPORT... 3 MAKE A SKETCH OF YOUR

Creating Reports in Access 2007 Table of Contents GUIDE TO DESIGNING REPORTS... 3 DECIDE HOW TO LAY OUT YOUR REPORT... 3 MAKE A SKETCH OF YOUR Creating Reports in Access 2007 Table of Contents GUIDE TO DESIGNING REPORTS... 3 DECIDE HOW TO LAY OUT YOUR REPORT... 3 MAKE A SKETCH OF YOUR REPORT... 3 DECIDE WHICH DATA TO PUT IN EACH REPORT SECTION...

More information

Microsoft Access Illustrated. Unit B: Building and Using Queries

Microsoft Access Illustrated. Unit B: Building and Using Queries Microsoft Access 2010- Illustrated Unit B: Building and Using Queries Objectives Use the Query Wizard Work with data in a query Use Query Design View Sort and find data (continued) Microsoft Office 2010-Illustrated

More information

C# Programming: From Problem Analysis to Program Design 2nd Edition. David McDonald, Ph.D. Director of Emerging Technologies. Objectives (1 of 2)

C# Programming: From Problem Analysis to Program Design 2nd Edition. David McDonald, Ph.D. Director of Emerging Technologies. Objectives (1 of 2) 13 Database Using Access ADO.NET C# Programming: From Problem Analysis to Program Design 2nd Edition David McDonald, Ph.D. Director of Emerging Technologies Objectives (1 of 2) Retrieve and display data

More information

Printing Envelopes in Microsoft Word

Printing Envelopes in Microsoft Word Printing Envelopes in Microsoft Word P 730 / 1 Stop Addressing Envelopes by Hand Let Word Print Them for You! One of the most common uses of Microsoft Word is for writing letters. With very little effort

More information

This Tutorial is for Word 2007 but 2003 instructions are included in [brackets] after of each step.

This Tutorial is for Word 2007 but 2003 instructions are included in [brackets] after of each step. This Tutorial is for Word 2007 but 2003 instructions are included in [brackets] after of each step. Table of Contents Just so you know: Things You Can t Do with Word... 1 Get Organized... 1 Create the

More information

Introduction to Microsoft Access 2016

Introduction to Microsoft Access 2016 Introduction to Microsoft Access 2016 A database is a collection of information that is related. Access allows you to manage your information in one database file. Within Access there are four major objects:

More information

Microsoft Access II 1.) Opening a Saved Database Music Click the Options Enable this Content Click OK. *

Microsoft Access II 1.) Opening a Saved Database Music Click the Options Enable this Content Click OK. * Microsoft Access II 1.) Opening a Saved Database Open the Music database saved on your computer s hard drive. *I added more songs and records to the Songs and Artist tables. Click the Options button next

More information

Microsoft Access XP (2002) Switchboards & Macros

Microsoft Access XP (2002) Switchboards & Macros Microsoft Access XP (2002) Switchboards & Macros Group/Summary Operations Creating a Switchboard Creating Macro Buttons From Wizards Creating Macros Manually Using the Condition Column Start Up Parameters

More information

Instructions for Using the Databases

Instructions for Using the Databases Appendix D Instructions for Using the Databases Two sets of databases have been created for you if you choose to use the Documenting Our Work forms. One set is in Access and one set is in Excel. They are

More information

All textures produced with Texture Maker. Not Applicable. Beginner.

All textures produced with Texture Maker. Not Applicable. Beginner. Tutorial for Texture Maker 2.8 or above. Note:- Texture Maker is a texture creation tool by Tobias Reichert. For further product information please visit the official site at http://www.texturemaker.com

More information

Using Microsoft Excel

Using Microsoft Excel Using Microsoft Excel Excel contains numerous tools that are intended to meet a wide range of requirements. Some of the more specialised tools are useful to people in certain situations while others have

More information

Office of Instructional Technology

Office of Instructional Technology Office of Instructional Technology Microsoft Excel 2016 Contact Information: 718-254-8565 ITEC@citytech.cuny.edu Contents Introduction to Excel 2016... 3 Opening Excel 2016... 3 Office 2016 Ribbon... 3

More information

Excel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller

Excel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller Excel Basics Rice Digital Media Commons Guide Written for Microsoft Excel 2010 Windows Edition by Eric Miller Table of Contents Introduction!... 1 Part 1: Entering Data!... 2 1.a: Typing!... 2 1.b: Editing

More information

Excel Intermediate

Excel Intermediate Excel 2013 - Intermediate (103-124) Advanced Functions Quick Links Range Names Pages EX394 EX407 Data Validation Pages EX410 EX419 VLOOKUP Pages EX176 EX179 EX489 EX500 IF Pages EX172 EX176 EX466 EX489

More information

PHPRad. PHPRad At a Glance. This tutorial will show you basic functionalities in PHPRad and

PHPRad. PHPRad At a Glance. This tutorial will show you basic functionalities in PHPRad and PHPRad PHPRad At a Glance. This tutorial will show you basic functionalities in PHPRad and Getting Started Creating New Project To create new Project. Just click on the button. Fill In Project properties

More information

CartêGraph Training Navigator

CartêGraph Training Navigator Navigator Agenda Overview Creating a Database Creating New Data Link Formating a Database Navigator Bar Connectivity Bar Toolbar Status Bar Records Adding Records Editing Records Saving Records Logging

More information

Using Microsoft Excel

Using Microsoft Excel Using Microsoft Excel Formatting a spreadsheet means changing the way it looks to make it neater and more attractive. Formatting changes can include modifying number styles, text size and colours. Many

More information

Program and Graphical User Interface Design

Program and Graphical User Interface Design CHAPTER 2 Program and Graphical User Interface Design OBJECTIVES You will have mastered the material in this chapter when you can: Open and close Visual Studio 2010 Create a Visual Basic 2010 Windows Application

More information

Book IX. Developing Applications Rapidly

Book IX. Developing Applications Rapidly Book IX Developing Applications Rapidly Contents at a Glance Chapter 1: Building Master and Detail Pages Chapter 2: Creating Search and Results Pages Chapter 3: Building Record Insert Pages Chapter 4:

More information

User Guide. Web Intelligence Rich Client. Business Objects 4.1

User Guide. Web Intelligence Rich Client. Business Objects 4.1 User Guide Web Intelligence Rich Client Business Objects 4.1 2 P a g e Web Intelligence 4.1 User Guide Web Intelligence 4.1 User Guide Contents Getting Started in Web Intelligence 4.1... 5 Log into EDDIE...

More information

GUI Design and Event- Driven Programming

GUI Design and Event- Driven Programming 4349Book.fm Page 1 Friday, December 16, 2005 1:33 AM Part 1 GUI Design and Event- Driven Programming This Section: Chapter 1: Getting Started with Visual Basic 2005 Chapter 2: Visual Basic: The Language

More information

Windows XP. A Quick Tour of Windows XP Features

Windows XP. A Quick Tour of Windows XP Features Windows XP A Quick Tour of Windows XP Features Windows XP Windows XP is an operating system, which comes in several versions: Home, Media, Professional. The Windows XP computer uses a graphics-based operating

More information

SQL Server. Management Studio. Chapter 3. In This Chapter. Management Studio. c Introduction to SQL Server

SQL Server. Management Studio. Chapter 3. In This Chapter. Management Studio. c Introduction to SQL Server Chapter 3 SQL Server Management Studio In This Chapter c Introduction to SQL Server Management Studio c Using SQL Server Management Studio with the Database Engine c Authoring Activities Using SQL Server

More information

Forms/Distribution Acrobat X Professional. Using the Forms Wizard

Forms/Distribution Acrobat X Professional. Using the Forms Wizard Forms/Distribution Acrobat X Professional Acrobat is becoming a standard tool for people and businesses to use in order to replicate forms and have them available electronically. If a form is converted

More information

Table of Contents. Table of Contents

Table of Contents. Table of Contents Powered by 1 Table of Contents Table of Contents Dashboard for Windows... 4 Dashboard Designer... 5 Creating Dashboards... 5 Printing and Exporting... 5 Dashboard Items... 5 UI Elements... 5 Providing

More information

Alma Analytics Beyond out-of-the-box reports: Tips for formatting and customization

Alma Analytics Beyond out-of-the-box reports: Tips for formatting and customization Alma Analytics Beyond out-of-the-box reports: Tips for formatting and customization Tricia Clayton tclayton3@gsu.edu Collection Services Librarian Georgia State University GIL User Group Meeting, 2018

More information

Creating Page Layouts 25 min

Creating Page Layouts 25 min 1 of 10 09/11/2011 19:08 Home > Design Tips > Creating Page Layouts Creating Page Layouts 25 min Effective document design depends on a clear visual structure that conveys and complements the main message.

More information

A Guided Tour of Doc-To-Help

A Guided Tour of Doc-To-Help A Guided Tour of Doc-To-Help ii Table of Contents Table of Contents...ii A Guided Tour of Doc-To-Help... 1 Converting Projects to Doc-To-Help 2005... 1 Using Microsoft Word... 10 Using HTML Source Documents...

More information

Windows Database Applications

Windows Database Applications 3-1 Windows Database Applications Chapter 3 In this chapter, you learn to access and display database data on a Windows form. You will follow good OOP principles and perform the database access in a datatier

More information

John W. Jacobs Technology Center 450 Exton Square Parkway Exton, PA Introduction to

John W. Jacobs Technology Center 450 Exton Square Parkway Exton, PA Introduction to John W. Jacobs Technology Center 450 Exton Square Parkway Exton, PA 19341 610.280.2666 ccljtc@ccls.org Introduction to Microsoft Access 2007 Introduction to Microsoft Access What is Microsoft Access? Access

More information

GSAK (Geocaching Swiss Army Knife) GEOCACHING SOFTWARE ADVANCED KLASS GSAK by C3GPS & Major134

GSAK (Geocaching Swiss Army Knife) GEOCACHING SOFTWARE ADVANCED KLASS GSAK by C3GPS & Major134 GSAK (Geocaching Swiss Army Knife) GEOCACHING SOFTWARE ADVANCED KLASS GSAK - 102 by C3GPS & Major134 Table of Contents About this Document... iii Class Materials... iv 1.0 Locations...1 1.1 Adding Locations...

More information

2 Getting Started. Getting Started (v1.8.6) 3/5/2007

2 Getting Started. Getting Started (v1.8.6) 3/5/2007 2 Getting Started Java will be used in the examples in this section; however, the information applies to all supported languages for which you have installed a compiler (e.g., Ada, C, C++, Java) unless

More information

Creating a new form with check boxes, drop-down list boxes, and text box fill-ins. Customizing each of the three form fields.

Creating a new form with check boxes, drop-down list boxes, and text box fill-ins. Customizing each of the three form fields. In This Chapter Creating a new form with check boxes, drop-down list boxes, and text box fill-ins. Customizing each of the three form fields. Adding help text to any field to assist users as they fill

More information

Introduction to SPSS

Introduction to SPSS Introduction to SPSS Purpose The purpose of this assignment is to introduce you to SPSS, the most commonly used statistical package in the social sciences. You will create a new data file and calculate

More information

Microsoft Office Illustrated Introductory, Building and Using Queries

Microsoft Office Illustrated Introductory, Building and Using Queries Microsoft Office 2007- Illustrated Introductory, Building and Using Queries Creating a Query A query allows you to ask for only the information you want vs. navigating through all the fields and records

More information

Using Dreamweaver CC. 5 More Page Editing. Bulleted and Numbered Lists

Using Dreamweaver CC. 5 More Page Editing. Bulleted and Numbered Lists Using Dreamweaver CC 5 By now, you should have a functional template, with one simple page based on that template. For the remaining pages, we ll create each page based on the template and then save each

More information

Introducing Databases

Introducing Databases 12 Introducing Databases WHAT YOU WILL LEARN IN THIS CHAPTER: What a database is and which databases are typically used with ASP.NET pages What SQL is, how it looks, and how you use it to manipulate data

More information

Understanding Acrobat Form Tools

Understanding Acrobat Form Tools CHAPTER Understanding Acrobat Form Tools A Adobe Acrobat X PDF Bible PDF Forms Using Adobe Acrobat and LiveCycle Designer Bible Adobe Acrobat X PDF Bible PDF Forms Using Adobe Acrobat and LiveCycle Designer

More information

Designer TM for Microsoft Access

Designer TM for Microsoft Access Designer TM for Microsoft Access Application Guide 1.7.2018 This document is copyright 2009-2018 OpenGate Software. The information contained in this document is subject to change without notice. If you

More information

EDITING AN EXISTING REPORT

EDITING AN EXISTING REPORT Report Writing in NMU Cognos Administrative Reporting 1 This guide assumes that you have had basic report writing training for Cognos. It is simple guide for the new upgrade. Basic usage of report running

More information

Copyright 2018 MakeUseOf. All Rights Reserved.

Copyright 2018 MakeUseOf. All Rights Reserved. 15 Power User Tips for Tabs in Firefox 57 Quantum Written by Lori Kaufman Published March 2018. Read the original article here: https://www.makeuseof.com/tag/firefox-tabs-tips/ This ebook is the intellectual

More information

6. Essential Spreadsheet Operations

6. Essential Spreadsheet Operations 6. Essential Spreadsheet Operations 6.1 Working with Worksheets When you open a new workbook in Excel, the workbook has a designated number of worksheets in it. You can specify how many sheets each new

More information

In Depth: Writer. The word processor is arguably the most popular element within any office suite. That. Formatting Text CHAPTER 23

In Depth: Writer. The word processor is arguably the most popular element within any office suite. That. Formatting Text CHAPTER 23 CHAPTER 23 In Depth: Writer The word processor is arguably the most popular element within any office suite. That said, you ll be happy to know that OpenOffice.org s Writer component doesn t skimp on features.

More information

Part 1: Understanding Windows XP Basics

Part 1: Understanding Windows XP Basics 542362 Ch01.qxd 9/18/03 9:54 PM Page 1 Part 1: Understanding Windows XP Basics 1: Starting Up and Logging In 2: Logging Off and Shutting Down 3: Activating Windows 4: Enabling Fast Switching between Users

More information

A Quick-Reference Guide. To access reddot: https://cms.hampshire.edu/cms

A Quick-Reference Guide. To access reddot: https://cms.hampshire.edu/cms Using RedDot A Quick-Reference Guide To access reddot: https://cms.hampshire.edu/cms For help: email reddot@hampshire.edu or visit http://www.hampshire.edu/computing/6433.htm Where is... Page 6 Page 8

More information

POS Designer Utility

POS Designer Utility POS Designer Utility POS Designer Utility 01/15/2015 User Reference Manual Copyright 2012-2015 by Celerant Technology Corp. All rights reserved worldwide. This manual, as well as the software described

More information

Barchard Introduction to SPSS Marks

Barchard Introduction to SPSS Marks Barchard Introduction to SPSS 22.0 3 Marks Purpose The purpose of this assignment is to introduce you to SPSS, the most commonly used statistical package in the social sciences. You will create a new data

More information

Desktop Studio: Charts. Version: 7.3

Desktop Studio: Charts. Version: 7.3 Desktop Studio: Charts Version: 7.3 Copyright 2015 Intellicus Technologies This document and its content is copyrighted material of Intellicus Technologies. The content may not be copied or derived from,

More information

Using Microsoft Excel

Using Microsoft Excel About Excel Using Microsoft Excel What is a Spreadsheet? Microsoft Excel is a program that s used for creating spreadsheets. So what is a spreadsheet? Before personal computers were common, spreadsheet

More information

Customization Manager

Customization Manager Customization Manager Release 2015 Disclaimer This document is provided as-is. Information and views expressed in this document, including URL and other Internet Web site references, may change without

More information

Advanced Reporting Tool

Advanced Reporting Tool Advanced Reporting Tool The Advanced Reporting tool is designed to allow users to quickly and easily create new reports or modify existing reports for use in the Rewards system. The tool utilizes the Active

More information

CHAPTER 3. Entering Text and Moving Around

CHAPTER 3. Entering Text and Moving Around CHAPTER 3 Entering Text and Moving Around Typing text is what word processing is all about. You can, in fact, create a perfectly respectable document by typing alone. Everything else all of the formatting

More information

1 Introduction to Using Excel Spreadsheets

1 Introduction to Using Excel Spreadsheets Survey of Math: Excel Spreadsheet Guide (for Excel 2007) Page 1 of 6 1 Introduction to Using Excel Spreadsheets This section of the guide is based on the file (a faux grade sheet created for messing with)

More information

Writer Guide. Chapter 15 Using Forms in Writer

Writer Guide. Chapter 15 Using Forms in Writer Writer Guide Chapter 15 Using Forms in Writer Copyright This document is Copyright 2005 2010 by its contributors as listed below. You may distribute it and/or modify it under the terms of either the GNU

More information

Taskbar: Working with Several Windows at Once

Taskbar: Working with Several Windows at Once Taskbar: Working with Several Windows at Once Your Best Friend at the Bottom of the Screen How to Make the Most of Your Taskbar The taskbar is the wide bar that stretches across the bottom of your screen,

More information

Microsoft Word Part I Reference Manual

Microsoft Word Part I Reference Manual Microsoft Word 2002 Part I Reference Manual Instructor: Angela Sanderson Computer Training Coordinator Updated by: Angela Sanderson January 11, 2003 Prepared by: Vi Johnson November 20, 2002 THE WORD SCREEN

More information

Using Dreamweaver CC. Logo. 4 Creating a Template. Page Heading. Page content in this area. About Us Gallery Ordering Contact Us Links

Using Dreamweaver CC. Logo. 4 Creating a Template. Page Heading. Page content in this area. About Us Gallery Ordering Contact Us Links Using Dreamweaver CC 4 Creating a Template Now that the main page of our website is complete, we need to create the rest of the pages. Each of them will have a layout that follows the plan shown below.

More information

ArtOfTest Inc. Automation Design Canvas 2.0 Beta Quick-Start Guide

ArtOfTest Inc. Automation Design Canvas 2.0 Beta Quick-Start Guide Automation Design Canvas 2.0 Beta Quick-Start Guide Contents Creating and Running Your First Test... 3 Adding Quick Verification Steps... 10 Creating Advanced Test Verifications... 13 Creating a Data Driven

More information

User's Guide c-treeace SQL Explorer

User's Guide c-treeace SQL Explorer User's Guide c-treeace SQL Explorer Contents 1. c-treeace SQL Explorer... 4 1.1 Database Operations... 5 Add Existing Database... 6 Change Database... 7 Create User... 7 New Database... 8 Refresh... 8

More information

Civil Engineering Computation

Civil Engineering Computation Civil Engineering Computation First Steps in VBA Homework Evaluation 2 1 Homework Evaluation 3 Based on this rubric, you may resubmit Homework 1 and Homework 2 (along with today s homework) by next Monday

More information

Desktop Studio: Charts

Desktop Studio: Charts Desktop Studio: Charts Intellicus Enterprise Reporting and BI Platform Intellicus Technologies info@intellicus.com www.intellicus.com Working with Charts i Copyright 2011 Intellicus Technologies This document

More information

Barchard Introduction to SPSS Marks

Barchard Introduction to SPSS Marks Barchard Introduction to SPSS 21.0 3 Marks Purpose The purpose of this assignment is to introduce you to SPSS, the most commonly used statistical package in the social sciences. You will create a new data

More information

ADD AND NAME WORKSHEETS

ADD AND NAME WORKSHEETS 1 INTERMEDIATE EXCEL While its primary function is to be a number cruncher, Excel is a versatile program that is used in a variety of ways. Because it easily organizes, manages, and displays information,

More information

CHAPTER 1 COPYRIGHTED MATERIAL. Finding Your Way in the Inventor Interface

CHAPTER 1 COPYRIGHTED MATERIAL. Finding Your Way in the Inventor Interface CHAPTER 1 Finding Your Way in the Inventor Interface COPYRIGHTED MATERIAL Understanding Inventor s interface behavior Opening existing files Creating new files Modifying the look and feel of Inventor Managing

More information

There are six main steps in creating web pages in FrontPage98:

There are six main steps in creating web pages in FrontPage98: This guide will show you how to create a basic web page using FrontPage98 software. These instructions are written for IBM (Windows) computers only. However, FrontPage is available for Macintosh users

More information

Shopping Cart: Queries, Personalizations, Filters, and Settings

Shopping Cart: Queries, Personalizations, Filters, and Settings Shopping Cart: Queries, Personalizations, Filters, and Settings on the Shopping Cart Home Page Use this Job Aid to: Learn how to organize the Shopping Cart home page so that it is easier to use. BEFORE

More information

VERSION JANUARY 19, 2015 TEST STUDIO QUICK-START GUIDE STANDALONE & VISUAL STUDIO PLUG-IN TELERIK A PROGRESS COMPANY

VERSION JANUARY 19, 2015 TEST STUDIO QUICK-START GUIDE STANDALONE & VISUAL STUDIO PLUG-IN TELERIK A PROGRESS COMPANY VERSION 2015.1 JANUARY 19, 2015 TEST STUDIO QUICK-START GUIDE STANDALONE & VISUAL STUDIO PLUG-IN TELERIK A PROGRESS COMPANY TEST STUDIO QUICK-START GUIDE CONTENTS Create your First Test.2 Standalone Web

More information

COPYRIGHTED MATERIAL. Making Excel More Efficient

COPYRIGHTED MATERIAL. Making Excel More Efficient Making Excel More Efficient If you find yourself spending a major part of your day working with Excel, you can make those chores go faster and so make your overall work life more productive by making Excel

More information

Easy Windows Working with Disks, Folders, - and Files

Easy Windows Working with Disks, Folders, - and Files Easy Windows 98-3 - Working with Disks, Folders, - and Files Page 1 of 11 Easy Windows 98-3 - Working with Disks, Folders, - and Files Task 1: Opening Folders Folders contain files, programs, or other

More information

MS Word Professional Document Alignment

MS Word Professional Document Alignment MS Word Professional Document Alignment Table of Contents CHARACTER VS. PARAGRAPH FORMATTING...5 Character formatting...5 Paragraph Formatting...5 USING SHOW/HIDE TO REVEAL NON-PRINTING CHARACTERS...5

More information

Excel Level 1

Excel Level 1 Excel 2016 - Level 1 Tell Me Assistant The Tell Me Assistant, which is new to all Office 2016 applications, allows users to search words, or phrases, about what they want to do in Excel. The Tell Me Assistant

More information

Some (semi-)advanced tips for LibreOffice

Some (semi-)advanced tips for LibreOffice Some (semi-)advanced tips for LibreOffice by Andy Pepperdine Introduction We cover several tips on special things in Writer and Calc and anything else that turns up. Although I use LibreOffice, these should

More information

VARIABLES. Aim Understanding how computer programs store values, and how they are accessed and used in computer programs.

VARIABLES. Aim Understanding how computer programs store values, and how they are accessed and used in computer programs. Lesson 2 VARIABLES Aim Understanding how computer programs store values, and how they are accessed and used in computer programs. WHAT ARE VARIABLES? When you input data (i.e. information) into a computer

More information

Intermediate Microsoft Access 2010

Intermediate Microsoft Access 2010 OBJECTIVES Develop Field Properties Import Data from an Excel Spreadsheet & MS Access database Create Relationships Create a Form with a Subform Create Action Queries Create Command Buttons Create a Switchboard

More information

THE EXCEL ENVIRONMENT... 1 EDITING...

THE EXCEL ENVIRONMENT... 1 EDITING... Excel Essentials TABLE OF CONTENTS THE EXCEL ENVIRONMENT... 1 EDITING... 1 INSERTING A COLUMN... 1 DELETING A COLUMN... 1 INSERTING A ROW... DELETING A ROW... MOUSE POINTER SHAPES... USING AUTO-FILL...

More information

Excel Tables & PivotTables

Excel Tables & PivotTables Excel Tables & PivotTables A PivotTable is a tool that is used to summarize and reorganize data from an Excel spreadsheet. PivotTables are very useful where there is a lot of data that to analyze. PivotTables

More information

Business Insight Authoring

Business Insight Authoring Business Insight Authoring Getting Started Guide ImageNow Version: 6.7.x Written by: Product Documentation, R&D Date: August 2016 2014 Perceptive Software. All rights reserved CaptureNow, ImageNow, Interact,

More information