|
FoxDataObjects |
Object-Relational Mapping Tool for Visual FoxPro® |
|
|
SetDefaultDataSource Method |
||
|---|---|---|
|
Sets the default datasource object by creating an empty datasource object for a given data store brand name and storing the object reference in the Server.DefaultDataSource property. Returns .T. (True) if successful.
|
|||||||||||||||||||
|
Return Values |
|||||||||||||||||||
|
|||||||||||||||||||
|
Parameters |
|||||||||||||||||||
|
|||||||||||||||||||
|
Remarks |
|||||||||||||||||||
|
The SetDefaultDataSource method receives a string parameter with the brand name of the server in order to instantiate a datasource object from the correct fdoDatasource subclass by calling Server.NewDataSource method. A case insensitive search is done over the brand name to detect this values:
If none of the substrings values exposed in the previous table can be located on the brand name string, the method returns .F. (False). If a valid data store brand name is passed, this method gets an empty datasource object for the fdoDataSource subclass corresponding to the requested data store and stores the object reference in the Session.DefaultDataSource property. The Server.DefaultDataSource property can be used by the Session.Connect method if no datasource object is specified.
|
|||||||||||||||||||
| Example | |||||||||||||||||||
|
oServer.SetDefaultDatasource("Ms SqlServer") oServer.DefaultDatasource.Database_Name="MyDatabase" |
|||||||||||||||||||
|
See Also |
|||||||||||||||||||
|
DataSource class | Server.NewDataSource method | Server.DefaultDataSource property | Session.Connect method | Server.DefaultDataSourceLookupMode property |
|||||||||||||||||||
| Applies to: Server object | |||||||||||||||||||
|
Send feedback on this topic to RunAhead Technologies For Technical support and product issues please contact us at support@foxdataobjects.com or visit http://www.foxdataobjects.com |
Copyright (c) 2000-2005 RunAhead Technologies