jeffheaton's picture

    There are several different database API's that can be used for database access under .NET. This book uses OLEDB under ADO. It would be relatively easy to adapt to using other ADO wrapped technologies such as ODBC. To access a database you must provide a OLEDB connection string. For example, Listing D.6 shows a spider.conf file that uses an OLEDB connection string to access a Microsoft Access Database.

Listing D.6: A Spider.CONF File for OLEDB

timeout:	60000
maxDepth:	-1
userAgent:
dbConnectionString: Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\spider.mdb
workloadManager:HeatonResearch.Spider.Workload.SQL.SQLWorkloadManager
startup:	clear
filter:		HeatonResearch.Spider.Filter.RobotsFilter

    The line that is specific to OLEDB is the dbConnectionString. The following line specifies to use a Microsoft Access Database through OLEDB.

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\spider.mdb

    Other databases can be used. Simply insert the correct connection string for the dbConnectionString attribute. Correct, and up to date, connection string information can be found with the documentation for the database you are using.


Copyright 2005 - 2012 by Heaton Research, Inc.. Heaton Research™ and Encog™ are trademarks of Heaton Research. Click here for copyright, license and trademark information.