FoxDataObjects

Object-Relational Mapping Tool for Visual FoxPro®

 NewDataSource  Method

 

 

Returns an empty datasource object for a given data store brand name.

 Server.NewDataSource( cServerBrandName )

 

Return Values

 

Object

   

Parameters

 

cServerBrandName

 

Specifies the data store brand name for the datasource object.

Remarks

 

The NewDataSource method receives a string parameter with the brand name of the server in order to instantiate a datasource object from the correct fdoDatasource subclass. A case insensitive search is done over the brand name to detect this values:

SubString

fdoDataSource subclass

"fox" fdoDataSource_VisualFoxPro
"sqlserver" fdoDataSource_MsSQLServer
"oracle" fdoDataSource_Oracle
"mysql" fdoDataSource_MySQL
"postgre" fdoDataSource_PostgreSQL
"sybase" fdoDataSource_SybaseASE
"db2"  fdoDataSource_IBMDB2
"fire"  fdoDataSource_FireBird

If none of the substrings values exposed in the previous table can be located on the brand name, the method returns the .NULL. value.

If a valid data store brand name is passed, this method instantiates and returns a pointer to an empty datasource object from the fdoDataSource subclass corresponding to the requested data store.

Example

oDS=oServer.NewDatasource("Ms SqlServer")

oDS.Database_Name="MyDatabase"
oDS.ODBC_SRV="192.168.0.1"
oDS.ODBC_UID="sa"
oDS.ODBC_PWD=cPassword
 

See Also

DataSource class | Server.SetDefaultDataSource method

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