PC Review


Reply
Thread Tools Rate Thread

altering .cdx files for visual foxpro

 
 
Bernie Yaeger
Guest
Posts: n/a
 
      21st Feb 2005
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




 
Reply With Quote
 
 
 
 
Cor Ligthert
Guest
Posts: n/a
 
      21st Feb 2005
Bernie,

I thought you knew this. Will you please be so kind not to multipost, now a
lot of us (including you) see this message more times, while when you
crosspost it (one message to all relevant newsgroups), we see as well all
answer from others in other newsgroups, and we don't have to search for a
solution as that is already given.

Thanks in advance.

Cor


 
Reply With Quote
 
Bernie Yaeger
Guest
Posts: n/a
 
      21st Feb 2005
Hi Cor,

But crossposting onto ado .net is not common, as not everyone reviews both
of these ng's - and that's why posting to fox.helpwanted also is not a cross
post.

Bernie

"Cor Ligthert" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Bernie,
>
> I thought you knew this. Will you please be so kind not to multipost, now
> a lot of us (including you) see this message more times, while when you
> crosspost it (one message to all relevant newsgroups), we see as well all
> answer from others in other newsgroups, and we don't have to search for a
> solution as that is already given.
>
> Thanks in advance.
>
> Cor
>



 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      21st Feb 2005
Bernie,

Most of the regulars in Adonet are often active in the other dotnet
newsgroup as well, take yourself.

However hoping not forgetting names, that is as well for Miha, Bill Ryan,
Sahil and Nick Malik, Paul, Frans, Scott, Jon, Chriss, Kevin etc. (I just
have taken some names, so when I forgot somebody, it is just to give Bernie
some examples).

Cor


 
Reply With Quote
 
Cindy Winegarden
Guest
Posts: n/a
 
      21st Feb 2005
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
>
>
>
>



 
Reply With Quote
 
Cindy Winegarden
Guest
Posts: n/a
 
      21st Feb 2005
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
>
>
>
>



 
Reply With Quote
 
Cindy Winegarden
Guest
Posts: n/a
 
      21st Feb 2005
Hi Bernie,

Perhaps you don't understand how cross-posting behaves in Outlook Express.

When you cross post the message shows up in each of the posted newsgroups
that the reader is subscribed to. When the reader reads the message it is
marked "read" in all groups the user subscribes to. When a user replies to
all the post will be posted to all threads on that news server, even if the
user is not subscribed to them. Finally, since all replies show in all
groups, the threads are kept together; also, people won't spend time
composing a reply to a question that's answered adequately in another
newsgroup.

Cross-posting is the preferred method to ask a question in a collection of
newsgroups such as ..fox.* and ..dotnet.* that are read by entirely
different audiences.


--
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)...
> Hi Cor,
>
> But crossposting onto ado .net is not common, as not everyone reviews both
> of these ng's - and that's why posting to fox.helpwanted also is not a
> cross post.



 
Reply With Quote
 
Frans Bouma [C# MVP]
Guest
Posts: n/a
 
      22nd Feb 2005
Cor Ligthert wrote:
> Bernie,
>
> I thought you knew this. Will you please be so kind not to multipost, now a
> lot of us (including you) see this message more times, while when you
> crosspost it (one message to all relevant newsgroups), we see as well all
> answer from others in other newsgroups, and we don't have to search for a
> solution as that is already given.


Please stop being the newsgroup cop. Also stop using my name as if I
agree with your twisted view on how people should use newsgroups.

Every decent newsreader filters out crossposted messages already marked
read in another newsgroup. Crossposting isn't something bad, just
because some former Intel employee wrote an old document in the
internet-stoneage telling you it is (in case you wonder what I mean: the
nettiquette RFC)

Frans

--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 
Reply With Quote
 
Frans Bouma [C# MVP]
Guest
Posts: n/a
 
      22nd Feb 2005
Cor Ligthert wrote:
> Bernie,
>
> Most of the regulars in Adonet are often active in the other dotnet
> newsgroup as well, take yourself.
>
> However hoping not forgetting names, that is as well for Miha, Bill Ryan,
> Sahil and Nick Malik, Paul, Frans, Scott, Jon, Chriss, Kevin etc. (I just
> have taken some names, so when I forgot somebody, it is just to give Bernie
> some examples).


Just to be clear, I totally disagree with Cor's views on usegroup
usage. Feel free to crosspost if you think you should.

FB

--
------------------------------------------------------------------------
Get LLBLGen Pro, productive O/R mapping for .NET: http://www.llblgen.com
My .NET blog: http://weblogs.asp.net/fbouma
Microsoft MVP (C#)
------------------------------------------------------------------------
 
Reply With Quote
 
Cor Ligthert
Guest
Posts: n/a
 
      22nd Feb 2005
Frans Bouma,
>
> Just to be clear, I totally disagree with Cor's views on usegroup usage.
> Feel free to crosspost if you think you should.
>


You are again bringing me in discredited in the newsgroups.

I asked (not told) Bernie to crosspost instead of multiposting.

An apologize is the least a man would do.

Cor.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Programmatic access to visual basic project via Visual FoxPro Jim Rech Microsoft Excel Programming 0 11th Jan 2007 01:53 PM
Passing information between Visual C++ .net & Visual FoxPro =?Utf-8?B?UmFjaGVs?= Microsoft VC .NET 2 29th May 2005 02:09 PM
Visual FoxPro Forms and Visual Studios DotNet =?Utf-8?B?SG9tZXlEYUNsb3du?= Microsoft Dot NET 4 16th Mar 2004 11:57 PM
C# vs. Visual FoxPro =?Utf-8?B?ai5iYWNo?= Microsoft VC .NET 2 16th Mar 2004 09:57 PM
Visual foxpro display & Files Setting David Shiraku Windows XP Customization 1 23rd Nov 2003 03:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:03 AM.