>I need a dual database in my application: SQL and Foxpro Tables (FOX2X not DBC).
>
>I need to create the tables for both programmatically.
>
>Working with Microsoft SQL and SQLCommand() it’s very easy to create a new database and the tables. This is working.
>
>I need the equivalent with OleDbCommand(), or am I just creating tables with SELECT statements (i.e. WHERE False – create table without records) and that’s all there is to it? How do I create indexes (CDXs) on these tables that will allow subsequent SQL commands to use Rushmore?
>
>The documentation for Microsoft’s Transact-SQL is very good, is there similar documentation for Foxpro table usage through OleDbCommand()?
>
>Thanks in advance.
Derek,
For creating tables and modifying structures etc "Create table", "Alter Table" series of SQL commands are supported by VFPOLEDB driver.
For indexes however your best bet is to use ExecScript as a stored procedure. ExecScript is the SP name and you pass the VFP code as its parameter. It can return back a single value or a resultset (so use ExecuteNonQuery, ExecuteScalar, ExecuteQuery, ExecuteReader as appropriate).
For a sample you can check a code I posted today:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2645213&SiteID=1The code there is a bit strange but that is because ExecScript code do not work with the same support when called from VFP code and outside VFP.
Cetin