9

The LA Fox Developer Newsletter
July 2000
ADO Jumpstart (Con’t from page 8)
oRecordset.Open
?oRecordSet.Fields.Count && number of fields in customers table oRecordset = oRecordset.NextRecordSet ?oRecordSet.Fields.Count && number of fields in orders table

In this case, the OLE DB Provider for SQL Server can return multiple recordsets. If you attempt the same thing with the OLE DB Provider for ODBC, which you need to use when accessing Visual FoxPro data, you will receive an error message stating that the requested action is not supported by the OLE DB provider.

Another example involves the way in which the Properties collection deals with the location of a Recordset object. Recordsets can either exist locally as client-side recordsets or they can exist remotely as server-side recordsets. Client-side recordsets, as will be discussed shortly, have several capabilities that server-side recordsets do not have. One of these abilities is to create indexes. The following code creates a client-side recordset:
oRecordset = CreateObject(”adodb.recordset”)
oConnection = CreateObject(”adodb.connection”)
With oConnection .Provider = “SQLOLEDB.1”
.connectlonStrlng = “Persist Security lnfoFalse;User
ID=sa;lnitial Catalog=Northwind;Data SourceJVP” .Open
dWith

~ecordset
Cursorlocation aduseclient && adUseclient = 3 .Activeconnection = oConnection .Source = “Products”
.Open
EndWith

Now, lets create an index on the ProductName field using the following code:
oRecordSet.Fields(”productname”)Properties(”optimize”).Value = .T.

In the absence of a declaration of where a Recordset object should reside, the Recordset object, by default, resides on the server. Attempting to reference the Optimize property results in an error stating that the specified property could not be found in the collection.

While the ADO interface is constant, depending on the provider you use, the capabilities may be very different. Be sure to consult your provider’s documentation.

(Ed.Note: The seventh and final installment, next month, will end this series.]
Miami DevCon...
DevCon Formally Announced
Once again Microsoft and FoxPro ADVISOR Magazine are proud to present Visual FoxPro DevCon. This 11th annual event is September24 - 28, 2000 at the spectacular Fontainebleau Hilton Resort & Towers in Miami Beach, Florida. The moment you’ve all been waiting for has arrived; session titles and descriptions are now available on the conference website. Visit http://www.Advisor.comlcmf0009p.nsf and take a look at how you can improve your knowledge of VFP and see what is coming in version 7.0. So, what are you waiting for? Register today! Remember if you register before August 1, 2000 you will save $200. You can either register on the web or call us at 800- 336-6060 or 858-278-5600.


Join
LA Fox
...and visit our website at:
h ttp ://www1la fox. org


It Can’t Get Any Easier.......
We’ve come up with an easy way to submit articles to the LA Fox DeveloperNewsletter one that has been overlooked for a long time.

You can submit your articles to Barry Leeat CIS# 72723,3422 on Compuserve, or brlee@earthlink.net.

These articles can be on any FoxPro-related topic, whether it concerns a new technique you’ve discovered, a certain development technique you may favor over others, book reviews, etc. Editor reserves the right to edit or offer constructive comments concerning submitted articles and accepted articles shall be considered to be in the public domain.

The quality of this newsletter really depends on the members that support it, not just read it. And I think we’d all be surprised by the useful information that could be circulated around the membership.

So.
How ‘bout it?
Page 9

9