Hi Bernie,
The following works just fine in VB 2003:
>>
Option Explicit On
Option Strict On
Imports System
Imports System.Data
Imports System.Data.OleDb
Module Module1
Sub Main()
Try
'-- Download and install the latest VFP OLE DB data provider
'-- from
http://msdn.microsoft.com/vfoxpro/do...s/default.aspx
'-- FoxPro code:
'-- Create Table C:\Temp\TestIndex Free (FirstName C(10),
LastName C(10))
'-- Index On LastName + FirstName Tag FullName
Dim conn As OleDbConnection
conn = New OleDbConnection("Provider=VFPOLEDB.1;Data
Source=C:\Temp;")
conn.Open()
'-- Lets create some data to work with
Dim cmd1 As New OleDbCommand("Insert Into TestIndex Values ('A',
'B')", conn)
Dim cmd2 As New OleDbCommand("Insert Into TestIndex Values ('X',
'Y')", conn)
Dim cmd3 As New OleDbCommand("Insert Into TestIndex Values ('F',
'G')", conn)
cmd1.ExecuteNonQuery()
cmd2.ExecuteNonQuery()
cmd3.ExecuteNonQuery()
'-- FoxPro code:
'-- Use C:\Temp\TestIndex Order FullName
'-- Command results:
'-- Firstname Lastname
'-- A B
'-- F G
'-- X Y
Catch ex As Exception
MsgBox(ex.ToString())
End Try
End Sub
End Module
<<
Why not use the FoxPro and Visual FoxPro OLE DB data provider?
Are you sure you're working with a CDX index and not an IDX index?
Does the index have the same name as the corresponding table?
What exactly are the index expressions on the table? Are there any
user-defined functions, etc.?
Does "modify data" mean anything other than insert/delete/update data?
--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
(E-Mail Removed) www.cindywinegarden.com
"Bernie Yaeger" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> My client has a visual foxpro app that he wants me to hook into. I'm
> connecting to it via odbc with this connectionstring:
> Dim oconn_d As New OdbcConnection("Driver={Microsoft Visual FoxPro
> Driver};SourceType=DBF;SourceDB=c:\test;exclusive=NO")
>
> These are free standing tables, all with .cdx files. I do not own nor do
> I intend to use vfp to work with this; rather, I am working with it
> exclusively inside vb .net. To display data, I have no problems; however,
> if he wants me to modify data, this requires altering the .cdx, which
> probably happens automatically using vfp, but not with odbc. What can I
> do to update .cdx files when accessing them via odbc?
>
> Tx for any help.
>
> Bernie Yaeger
>
>
>
>