Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating Databases & Tables Programmatically
Message
From
09/01/2008 12:00:13
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
ASP.NET
Category:
ADO.NET
Miscellaneous
Thread ID:
01280580
Message ID:
01280612
Views:
15
>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=1

The 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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform