Posts Tagged ‘news’

Microsoft Store
 Powered by Max Banner Ads 

Try Microsoft Office Default

Friday, September 10th, 2010

Try Microsoft Office Default
Try Microsoft Office Default

Vulnerability in the Microsoft Security Update PowerPoint

In Microsoft PowerPoint 2000 or Microsoft PowerPoint 2002, you try to open a presentation using the Microsoft PowerPoint 4.0 format. However, the presentation does not open, and the following error message:
This file has an older format which is not compatible.

Because security issues with the parsing code used to open and save PowerPoint presentations 4.0, this update security eliminates the possibility of opening these files.

This problem occurs after you install security update MS09-017. This security update addressed vulnerabilities in the parsing code that was used to open and save files in PowerPoint format by preventing types of Microsoft Office PowerPoint 2000 and Microsoft Office PowerPoint 2002 to open PowerPoint 4.0 format native file.

By default, this behavior is enabled in Microsoft Office 2003 Service Pack 3. Microsoft Office PowerPoint 2003 presentations will not open With PowerPoint 4.0 file format. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
Abou t 938 810 Information certain types of files that are blocked after you install Office 2003 Service Pack 3
Microsoft Security Advisory (969 136)
Vulnerability in PowerPoint Microsoft Office could allow remote code execution.
Version: 2.0

Microsoft has completed the investigation of a public report this vulnerability. they have issued MS09-017 to address this issue. For more information about this issue, check here

Also check out Microsoft Security Bulletin Summary for May 2009 is used to open and save PowerPoint files by preventing type format of Microsoft Office PowerPoint 2000 and Microsoft Office PowerPoint 2002 to open PowerPoint 4.0 formats.PowerPoint 2002 native file, try opening a presentation use the Microsoft PowerPoint 4.0 format. However, the presentation does not open, and you receive the following error message:

About the Author

http://reviews-mann.blogspot.com/2010/02/final-fantasy-xiii-preview.html

http://twitter.com/lizareckon

http://www.google.com/profiles/mannzunty

How to change the DEFAULT Font In Microsoft Office Word

Building Data Aware Applications with Visual FoxPro Part 3: Universal Data Access

Summary: In this series of articles, we have Visual Library shown that classes are a great place to store your access code to the data (and thus, eliminate duplication of similar code and reducing the complexity of application). So far, in previous articles (Part 1 and Part 2 of this series of articles), we assumed that we are building "Fox" pure and applications have therefore used the 'use' Every time we need access to data stored in the FoxPro database. Without But the complexity of today's applications often require our VFP applications to be flexible enough to access other data stores of our native databases Fox loved and tables. This article explains how to extend data-aware classes for Universal Data Access Visual FoxPro style (ie, access other data stores Visual FoxPro and Advantage Database Server or Microsoft SQL Server.) This article uses MS SQL Server 2005.

Introduction: so far This article series has been assumed that the data access code in our Visual Class Library (VCX) will have access to databases and native Visual FoxPro tables. However, although the Fox offers excellent storage capacity, sometimes want or need to benefit from greater storage capacity, enhanced security and Additional security provided by SQL Server transaction in the development of enterprise applications.

In this scenario, we can still maximize tremendous power, speed and engine performance database and Visual FoxPro programming language to create powerful enterprise-class applications quickly and efficiently. Visual class libraries still represent an excellent location to store data access code to access and process the data located in remote data storage and external. This means using a Visual FoxPro front end to access and process data in other data stores.

Universal Data Access Visual FoxPro: In VFP, there is always more than one way to accomplish the same task. To access and use of remote data in VFP, you can for example use remote views or queries SQL Pass through (SPT) technology which are two of the intensive use of Open Data Base Connectivity (ODBC) as the primary means of data access, recovery and updates.

The term remote data as used in this article refers to data stored outside of a database Visual FoxPro traditional, either on the same computer or on a computer other than the one in which the Visual FoxPro application is running. For example, data stored on a server Advantage Microsoft SQL Server database or to be consumed by a Visual FoxPro can be considered remote data in this case.

Even if the SPT and remove points of view are very powerful means of making data accessible distance to your application, Visual FoxPro Cursor Adapter will most probably remain the most flexible means of doing this, as it provides the flexibility to reach remote data through different types of data source. With Cursor adapters can access native (VFP) stores the data, ODBC data sources (ie, data exposed through ODBC), ADO data sources (ie, the data exposed through ActiveX Data Objects) or XML data sources.

Most programmers or Visual VFP programmers building core business applications will be immediately familiar with ODBC and ADO as these have been the main means of data access for SQL Servers in the Microsoft platform for years. Perhaps the XML data set could compete with these if you need to consume ADO.Net datasets from VFP application or XML data sets published by other support tools and use the XML standard.

The Cursor Adapter provides many capabilities, giving precise control over how to manage your data sources, retrieve, edit and update data. Data returned by the cursor adapter represents a native Visual FoxPro cursor so you could work with him as you would with the cursors created from tables Visual FoxPro native. The Visual FoxPro Help message contains good information about the shape of the cursor adapters and the work of their properties.

We can use cursor adapters to retrieve data, add new records, edit existing records and delete records from databases unwanted remote data. What is of interest key for us is the ability of adapters to consume data cursor OLE DB / ADO data sources, data sources and ADO.Net ODBC data sources (XML, course).

In this article, we will demonstrate that work with data stored in a SQL Server using Cursor Adapters wrapped in a kind of access to data contained in a Visual Class Library (VCX). Our employees ubiquitous table that we have always used in the previous article in this series is once stored in a Database SQL Server Express 2005, calls pc sqlexpress.students.dbo-syl. Let's get to our database of SQL Server with SQL Server OLE DB.

Building our customers data access class: First we must create our data access classes as usual. In articles previous classes we have created in Visual class library which you add the code. The best way to access SQL Server from Visual FoxPro will be based on their OLE DB provider. Visual FoxPro now offers broad support for access to database servers using OLE DB / ADO. This means creating and using all objects ADO normal are used in Visual Basic. For example:

LOCAL oConn AS ADODB.Connection "

AS LOCAL oRS "ADODB.Recordset"

oConn = CREATEOBJECT ("ADODB.Connection")

oRS = CREATEOBJECT ("ADODB.Recordset")

etc.

would be perfectly valid statements. However, although you can use pure ADO code this way of working with the recordset returned, the result would almost certainly be feel natural. By throwing the cursor adapter in the mix, you get the ability to work with ADO recordset like a native Visual FoxPro cursor. This means that apart from the code that creates and returns the ADO recordset object as shown above, can perform his usual Visual FoxPro commands like APPEND BLANK, REPLACE, FIND, etc. Various steps are involved in putting together this solution: 1) We have created our database in SQL Server, 2) We need to create a VFP project, 3) Add a library class called 'Access' data 4) Add a "class of customers and add all Methods, 5) Add a new form and put it down.

Let's start step by step then

1) Create the table on SQL Server CustMast 2005 Express: Our solution uses a SQL Server 2005 Express Database - 'Database2SQL. This database contains a table' CustMast "Used in this example. CustMast Table has the following structure:

Column Name

Data Type

Allow Nulls

Primary Key

CustomerID

Char (20)

N

Y

CustName

Char (50)

Y

 

Contact

Char (50)

Y

 

NoOfAddre

Int

Y

 

NoOfTels

Int

Y

 

To create your database, you need a tool that allows you to connect and create databases SQL Server 2005 Express. Unfortunately, VFP Data Explorer allows you to create connections and SQL Server 2005 Query Databases, not create new ones! If you have Visual Studio 2005, you can create databases and edit SQL Server 2005 schema. Alternatively, you can use Microsoft Access 2007, the program database in the Microsoft Office suite to create an Access project through which you can create your database SQL Server 2005. For more information on how to perform these tasks, refer to Microsoft Access or the Visual Studio 2005 documentation.

After successfully building its database SQL Server 2005 and the addition CustMast table to it, you can use the Data Explorer in Visual FoxPro 9 (accessible by choosing the Explorer button panel data in Task Manager) to navigate through the SQL Server and other data sources. If you can not see your SQL Server in the list, choose the Add Connection button to create a connection to SQL Server so you can see all databases on it.

2) Create VFP project: Now with the SQL Server side of things done, we must create a VFP project by undertaking the following measures: i) Start VFP and then select New Project on the home page of the Task Pane Manager. The Create dialog box displays, ii) Table Project Type File box, type 'CusAdapter' (without the quotes) and select the Save button. VFP creates a new project. You are now ready to add items to your project.

3) Create your Visual class library: After creating your draft VFP, you create a Visual Class Library Classes tab of the Project Manager and add a class to it. We will call the class library of our data access " and adds the class' CustMast. We can create the class library by performing the following actions: i) Choose the New button Sheet the project manager classes to display the dialog box New Class, ii) In the name box class type 'CustMast "without quotes, iii) that based on the list, select cursor adapter, iv) in store, type 'DataAccess "without quotes, v) Click OK. The system will create a new Visual Class Library and add a new class white for him. Now you're ready to schedule your class.

4) Add code to our class: we now you must add code useful to our class data access. We've added three methods to search for existing records, to delete a existing record and add new records.

  1. Add a record: This method is called AddRecord. Let our program to insert a new record in the SQL Server table. It looks like this:

PARAMETERS Arre, intNoOfRecs As Integer

* Declare Variable used locally

PUBLIC OCA as CursorAdapter

LOCAL oConn as ADODB.Connection

LOCAL oRS as ADODB.Recordset

LOCAL oException as an exception

LOCAL cConnString

IntRows LOCAL AS Integer, cmsg As characters

intRows = 0

cmsg = ""

IF TYPE ('arre', 1) <> "A"

* Exists because we expected a matrix of value

RETURN. F.

ENDIF

IF TYPE ('intNoOfRecs') <> 'N'

* Check if the number last row in the array is not supplied

RETURN. F.

ENDIF

* Manage the connections - connecting insert code

cConnString = [Provider = SQLOLEDB.1; Data Source = SYL-PC SQLEXPRESS: initial catalog = Database2SQL; User ID =; Password =; Integrated Security = SSPI]

IF NOT USED ("CustMast") & & the cursor does not exist create it ...

TEST

oConn = CreateObject ('ADODB.Connection')

* Make sure you manage username and password if not

* Specified in the connection string.

* Ex oConn.Open (cConnString, user ID, password)

oConn.Open (cConnString)

oRS = CreateObject ("ADODB.Recordset")

oRS.DataSource.CursorLocation = 3 & & adUseClient

oRS.DataSource.LockType adLockOptimistic = 3 & &

oRS.ActiveConnection = oConn

THIS.DataSourceType = "ADO"

THIS.DataSource = oRS

THIS.MapBinary =. T.

THIS.MapVarchar =. T.

THIS.Alias = "CustMast"

THIS.SelectCmd = "SELECT * FROM CustMast"

YES! THIS.CursorFill ()

* Replace with error code here

LOCAL laError

DIMENSION laError [1]

Aerror (LaError)

MESSAGEBOX (laError [2])

ELSE

* Replace with user code here. Allows code below

* You can edit and send updates to the server.

LOCAL laFlds, lcStr, lnFldCount, i

DIMENSION laFlds [1]

lnFldCount = AFIELDS (LaFlds)

lcStr = ""

FOR i = 1 TO lnFldCount

laFlds lcStr lcStr = + [mi, 1] + ""

ENDFOR

THIS.UpdatableFieldList = lcStr

THIS.KeyFieldList = "CustomerID"

* BROWSE NORMAL NOWAIT

ENDIF

CATCH A oException

* Replace with exception handling code here

MESSAGEBOX (oException.Message)

ENDTRY

ENDIF

* Add user code here.

* Note: The object created by CursorAdapter cursors are closed when the object is released.

SELECT CustMast

FOR = 1 TO intNoOfRecs intRows

SI ISBLANK (ARRE (intNoOfRecs, 1))

* No record was provided to and exit

oRs.Close

ORS PRESS

RETURN. F.

ENDIF

SELECT CustMast

GO TOP

LOCATE FOR ALLTRIM (CustMast-> CustomerID) = ALLTRIM (ARRE (intRows, 1))

If not found ()

APPEND BLANK

REPLACE CustMast-> CustomerID in accor (intRows, 1)

ENDIF

REPLACE CustMast-> CustName WITH arre (intRows, 2)

REPLACE CustMast-> Contact arre (intRows, 3)

REPLACE CustMast-> NoOfAddre WITH arre (intRows, 4)

REPLACE CustMast-> NoOfTels WITH arre (intRows, 5)

ENDFOR

The first line is the line of parameters it accepts the parameters "Arre two" (array containing one or more records that are kept) and intNoOfRecs "(An integer that defines the total number of records contained in the matrix). Along these lines, the variables are declared and initialized to their correct values. OCA is a Cursor Object Adapter, oConn is a data object ADO, while oRS an ADO Recordset object. Type functions are used to ensure that arre intNoOfRecs and are of the correct types. In Visual FoxPro components, passing parameters of the right type is essential to make or break your application. We have found VFP errors that ordinarily treated kindly in a form or a program file, VFP is quite hard on the components! The variable oConnString then contains the connection string that is used to connect to our SQL Server OLE DB and through it to our database server SQL. Provider = SQLOLEDB.1 indicates that we are using the MS SQL Server OLE DB. The Data Source = SYL-PC SQLEXPRESS indicates the name of the SQL server you are connecting. Initial Catalog = Database2SQL indicates the database containing the table we want in the SQL Server.

The CreateObject function is now used to create the connection object (oConn = CREATEOBJECT ("ADODB.Connection")) then immediately opened (oConn.Open). Another CreateObject function creates an ADO Recordset object (RUP = CREATEOBJECT ("ADODB.Recordset"). The cursor of the recordset is then set as a client-side cursor and LockType is set to 3, which represents the optimistic lock. Its purpose ActiveConnection is set to the ADO connection object created earlier - oConn. The next series of statements specify a data source type and alias name ('CustMast') adapter for Cursor objects. The SelectCmd is a simple SQL SELECT command that returns all rows from the table. This simply returns all rows Master in the customer table and stores the results of this query in a cursor named "CustMast. (Of course in a real-Live solution, most likely is that you need to achieve a price of relativizing the SQL command with a WHERE clause reducing the number of packets that must travel over the network)

The CursorFill method is used to execute the command SelectCmd. If it fails, errors are stored in the array LaError so we can investigate and deal with the mistakes of others, we can build a list of fields so we can update to the server. The fields in this list will determine what fields in the VFP table updates if you decide to send updates to SQL Server. The comma delimited field is passed to the updatable UpdatableFieldList. The KeyFieldList also must be set to tell VFP primary key field in your table. In our case, "CustomerID". The intRows FOR ... intNoOfRecs ENDFOR now runs every record in the array and then issues the standard APPEND BLANK and REPLACE commands to insert new records and store changes to an existing record.

  1. Find a record: If you want to display an existing record for editing or viewing a record you want to delete, you will have to find the record and submit. The procedure is shown below find the record that matches the key and then returns an array. The code This method is similar to this:

* Search for a registry that meets the criteria

PARAMETERS cCustomerID as character, arre, intNoOfRecs As Integer

PUBLIC OCA as CursorAdapter

LOCAL oConn as ADODB.Connection

LOCAL oRS as ADODB.Recordset

LOCAL oException as an exception

LOCAL cConnString

LOCAL intRows As Integer

intRows = 0

* Make sure that the parameters supplied are of the correct types

IF TYPE ('cCustomerID ") <>' C '& & Customer ID must be a character

RETURN. F.

ENDIF

IF TYPE ('arre', 1) <> 'A' & & Should be an array Arre

RETURN. F.

ENDIF

IF TYPE ('intNoOfRecs') <> "N" & & IntNoOfRecs must be a number

RETURN. F.

ENDIF

* Manage the connections - connecting insert code

cConnString = [= SQLOLEDB.1 Provider, Data Source = SYL-PC SQLEXPRESS; Initial Catalog = Database2SQL; User ID =; Password =; Integrated Security = SSPI]

If used ("CustMast)

* Close so that the possibility of recent records show

USE CustMast

ENDIF

TEST

oConn = CreateObject ('ADODB.Connection')

* Make sure you handles user name and password if not

* Specified in the connection string.

* Ex oConn.Open (cConnString, user ID, password)

oConn.Open (cConnString)

oRS = CreateObject ("ADODB.Recordset")

oRS.DataSource.CursorLocation = 3 & & AdUseClient

oRS.DataSource.LockType adLockOptimistic = 3 & &

oRS.ActiveConnection oConn =

OCA = CREATEOBJECT ("CursorAdapter)

oCA.DataSourceType = "ADO"

oCA.DataSource = ORS

oCA.MapBinary =. T.

oCA.MapVarchar =. T.

oCA.Alias = "CustMast"

oCA.SelectCmd = "SELECT * FROM WHERE = CustMast CustMast.CustomerID '"+ CCustomerID +"' "

YES! OCA.CursorFill ()

* Replace with error code here

LOCAL laError

DIMENSION laError [1]

Aerror (laError)

MESSAGEBOX (laError [2])

ELSE

* Replace with user code here. Allows code below

* Edit and send updates to the server.

LOCAL laFlds, lcStr, lnFldCount, i

DIMENSION laFlds [1]

lnFldCount = AFIELDS (laFlds)

lcStr = ""

FOR i = 1 TO lnFldCount

laFlds lcStr lcStr = + [mi, 1] + ""

ENDFOR

oCA.UpdatableFieldList = lcStr

oCA.KeyFieldList = "CustomerID"

* BROWSE NORMAL NOWAIT

SELECT CustMast

Do While Not EOF ()

IF ALLTRIM (CustMast-> CustomerID) = ALLTRIM (cCustomerID)

intRows intRows = + 1

Arre DIMENSION [intRows 5]

Arre (intRows, 1) = CustMast-> CustomerID

Arre (intRows, 2) =- CustMast CustName>

Arre (intRows, 3) =- CustMast contact>

Arre (intRows, 4) = CustMast-> NoOfAddre

Arre (intRows, 5) = CustMast-> NoOfTels

EXIT

ENDIF

ENDDO

intNoOfRecs = intRows

ENDIF

CATCH A oException

* Replace with exception handling code here

MESSAGEBOX (oException.Message)

ENDTRY

The FindRecord method bears some resemblance to the method AddRecord. Line pass parameters to search customer ID along with an empty array to store all records that meet the criteria for these may be returned to the calling program (in this case the form). The SQL SELECT statement is qualified with a WHERE clause. This is a classic example of "go as needed" paradigm for creating effective programs that reduce network traffic VFP and perform efficiently. Once CursorFill method populates the array, a Do While ... loop ENDDO fill the array.

  1. Delete a record: This method is called RemoveRecord and removes the registration of the SQL server table. The code is as follows:

* Search for a registry that meets the criteria

PARAMETERS cCustomerID As characters

PUBLIC OCA as CursorAdapter

LOCAL oConn as ADODB.Connection

LOCAL oRS as ADODB.Recordset

LOCAL oException as an exception

LOCAL cConnString

LOCAL intRows As Integer

intRows = 0

* Ensure that the parameters supplied are of the right kinds

IF TYPE ('cCustomerID') <> 'C' & & client ID must be a character

RETURN. F.

ENDIF

*! * IF TYPE ('arre', 1) <> "A" & & must be an array Arre

*! * RETURN. F.

*! * ENDIF

*! * IF TYPE ('intNoOfRecs') <> 'N' & & intNoOfRecs must be a number

*! * RETURN. F.

*? * ENDIF

* Manage the connections - connecting insert code

cConnString Provider = [= SQLOLEDB.1; Data Source = SYL-PC SQLEXPRESS; Initial Catalog = Database2SQL; User ID =; Password =; Integrated Security = SSPI]

If used ("CustMast)

* Close so that the possibility of obtaining the latest records for viewing

USE CustMast

ENDIF

TEST

oConn = CreateObject ('ADODB.Connection')

* Make sure you drive name username and password if not

* Specified in the connection string.

* Ex oConn.Open (cConnString, user ID, password)

oConn.Open (cConnString)

oRS = CreateObject ("ADODB.Recordset")

oRS.DataSource.CursorLocation = 3 & & adUseClient

oRS.DataSource.LockType = 3 & & adLockOptimistic

oRS.ActiveConnection oConn =

OCA = CREATEOBJECT ("CursorAdapter)

oCA.DataSourceType = "ADO"

oCA.DataSource = ORS

oCA.MapBinary =. T.

oCA.MapVarchar =. T.

oCA.Alias = "CustMast"

oCA.SelectCmd = "SELECT * FROM WHERE = CustMast CustMast.CustomerID '"+ CCustomerID +"' "

YES! OCA.CursorFill ()

* Replace with error code here

LOCAL laError

DIMENSION laError [1]

Aerror (laError)

MESSAGEBOX (laError [2])

ELSE

* Replace with user code here. Allows code below

* You can edit and send out updates to the server.

LOCAL laFlds, lcStr, lnFldCount, i

DIMENSION laFlds [1]

lnFldCount = AFIELDS (laFlds)

lcStr = ""

FOR i = 1 TO lnFldCount

laFlds lcStr lcStr = + [mi, 1] + ""

ENDFOR

oCA.UpdatableFieldList = lcStr

oCA.KeyFieldList = "CustomerID"

SELECT CustMast

TO DELETE ALLTRIM (CustMast-> CustomerID) = ALLTRIM (cCustomerID)

ENDIF

CATCH A oException

* Replace the exception handling code here

MESSAGEBOX (oException.Message)

ENDTRY

This code is exactly the same code to find a disc with very minor variations. We use FOR a DELETE to delete a record. Because we have not made an adjustment for CursorAdapter DeleteCmd property, the automatically generated CursorAdapter SQL DELETE command to perform the removal, as long as CursorAdapter AllowDelete property is set to true (. T.), the default.

5) Create a data entry form: Now to complete this example, we create a form input. The form could include controls designed to display all the fields in the SQL Server Tables. The data entry form may contain the following controls:

  1. txtCustomerID: This is a text box control. It will be used to enter the customer ID or a screen for editing. When enter a value here, the ion valid event code be used to verify if this client already exists on the database application. In this sense, we call the method FindRecord CursorAdapter class.
  2. txtCustName: This is the name of the client. Show a client name or you can type a customer name to it.
  3. txtContact: Name of main contact person.
  4. txtNoOfAddr: Total number of addresses received from this customer.
  5. txtNoOfTels: Total number of phones received from this client
  6. cmdAddRecord: Command button click event code that calls the method AddRecord CursorAdapter class.
  7. cmdDelete: Command click the button event code calls the method RemoveRecord CursorAdapter class.
  8. cmdBrowse: Display data returned from SQL Server in browse mode.
  9. cmdNew: Shows a blank record template so that you can create a new registration.
  10. Legend Form: Set Form title "Master of the Customer.

AS our visual class library, the form will also contain the code as follows:

  1. Display an existing record: We will use the same form to add new records, the records amending existing save changes, and delete records from our table not allowed database SQL Server. The code to do that is placed in the validation if the text field txtCustomerID. When a user enters an identification number on the CustomerID field, the system calls the method of our class FindRecord conducting the search. If the FindRecord method locates the record in the table in SQL Server the file is returned in an array form that is displayed for editing or deletion as the case may be. Note that the event passes an arre empty array and a variable number of intNoOfRecs. IntNoOfRecs not strictly necessary in this example, but illustrates that it is possible to return more than one class registration form that is stored locally in a cursor (in this case, we are not using it.) The valid event code in the text box txtCustomerID looks like this:

* Search for the registration of a client who meets the criteria and then display the record for editing

SI ISBLANK (this.Text)

RETURN

ENDIF

LOCAL OCU as an object, intNoOfRecs As Integer, lAnswer As a logical

Arre DIMENSION [1,5]

arre [1,1] = THISFORM.txtCustomerID.Value

arre [1,2] = THISFORM.txtCustName.Value

arre [1,3] = THISFORM.txtContact.Value

arre: [1,4] = THISFORM.txtNoOfAddr.Value

arre [1,5] = THISFORM.txtNoOfTels.Value

intNoOfRecs = 0

ADJUSTMENT OF REFERENCE UDFPARMS

ADJUSTMENT ADDITIVE TO CLASSLIB DataAccess

OCU = CREATEOBJECT ("CustMast)

lAnswer oCu.FindRecord = (This.Value, arre, intNoOfRecs)

IntNoOfRecs SI> 0

Arre THISFORM.txtCustName.Value = (1,2)

THISFORM.txtContact.Value arre = (1,3)

THISFORM.txtNoOfAddr.Value arre = (1.4),

THISFORM.txtNoOfTels.Value arre = (1.5)

ENDIF

  1. Add / Saving Registration: To add a record to our table of SQL Server or save the changes we made, we add a command button click cmdAddRecord which contains event the following code:

LOCAL OCU as an object, intNoOfRecs As Integer, lAnswer As a logical

Arre DIMENSION [2,5]

arre [1,1] = THISFORM.txtCustomerID.Value

arre [1,2] = THISFORM.txtCustName.Value

arre [1,3] = THISFORM.txtContact.Value

arre [1,4] = THISFORM.txtNoOfAddr.Value

arre [1,5] = THISFORM.txtNoOfTels.Value

intNoOfRecs = 1

ADJUSTMENT OF REFERENCE UDFPARMS

DataAccess CLASSLIB ADDITIVE ADJUSTMENT

OCU = CREATEOBJECT ("CustMast)

lAnswer = oCu.AddRecord (Gee, intNoOfRecs)

This code is simple. Arre Fill a matrix with the values entered in the controls on the form, then passes the array to the method of our class AddRecord that connects to SQL Server table to store the record. Table is checked to see if the record already exists. Doing so will save any changes you has done nothing else, the new record is inserted using APPEND BLANK. This means that to modify an existing record and save your changes, enter a existing ID CustomerID field to display the record, make changes on the registration form, and then choose AddRecord button to save your changes.

  1. Delete an existing record: Button cmdDelete meets the ability to remove unwanted records from SQL server table. Method is called RemoveRecord class passing the customer ID entered into the text box txtCustomerID field. The code is as follows:

To delete a record, you must enter the ID of the client whose record you want to delete into the text box txtCustomerID field to make the registration screen after then choose or click Delete button to delete the record.

  1. Show a blank record template: We've added cmdNew button that allows us to obtain a blank template record. Clicking this button puts an end to record displayed allowing you begin work on a new record. The code for the Click event of this command button appears as follows:

THISFORM.txtCustomerID.Value = ""

THISFORM.txtCustname.Value = ""

THISFORM.txtContact.Value = ""

THISFORM.txtNoOfAddr.Value = 0

THISFORM.txtNoOfTels.Value = 0

THISFORM.txtCustomerID.SetFocus

You will find that same button code called on both the Save and Delete buttons through the single line: cmdNew.Click

Conclusions: This article demonstrates the ability of Visual FoxPro to access multiple sources of external data using the CursorAdapter. In this example, we have shown themselves capable of reach the data stored in a SQL Server 2005 database. Access to data is accomplished through the use of a component to access data stored in a Visual Class Library (VCX) to connect to the database SQL Server 2005. The matrices are used to move data between the form and type of data access. Although we mainly made ActiveX Data Objects (ADO) in our example, CursorAdapters allow you to use native Visual FoxPro (VFP) Data, Open Database Connectivity (ODBC) and Extensible Markup Language (XML). This means that the method of access to specific data you choose to obtain external data tailored to the task, the requirements of the system in particular it is building and the database or a data type you want to access. Although we wanted to limit our simple and rudimentary example to demonstrate the concept of base, you can easily build powerful enterprise-level applications using a combination of other concepts such as local cursors to cache data returned in the form matrix, with application of buffering the data created by CursorAdapter or combining the power and programmability CursorAdapters to expand its environment typical data.

About the Author

Sylvester Alelele is a Senior Systems Analyst/Programmer and Group Head of Operations for Forest-Elephant Technology & Procurement Group Plc. He lives and works in Addis Ababa Ethiopia. He develops applications with Microsoft Visual FoxPro, Visual Basic and the .Net Framework, Oracle, Advantage Database Server and Ms SQL Server. He has over sixteen (16) years of experience building enterprise database solutions of all sizes



phpbay]Try Microsoft Office Default, 51, "", ""[/phpbay]

SpeedyPC
 Powered by Max Banner Ads