Sample Example to create one ColdFusion datasource for SQL server with Administrator API call:
<cfscript>
// Create an object of administrator component and call the login method
adminObj = createObject("component","cfide.adminapi.administrator");
adminObj.login("CFADMIN Password will go here");
// Create an object of datasource component
dsnObj = createObject("component","cfide.adminapi.datasource");
// Setting up the parameter values for datasource
stDSN = structNew();
stDSN.driver = "MSSQLServer";
stDSN.name="Datasource name will go here";
stDSN.host = "Database server name/IP will go here";
stDSN.port = "1433";
stDSN.database = "Database name will go here";
stDSN.username = "Database access user name will go here";
stDSN.password = "Database access password will go here";
stDSN.description = "Datasource description will go here";
// Create MSSQL datasource
dsnObj.setMSSQL(argumentCollection=stDSN);
// Call logout method
adminObj.logout();
</cfscript>
</o:p>
For more information please visit: http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=basiconfig_37.html