altering .cdx files for visual foxpro

B

Bernie Yaeger

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
 
C

Cor Ligthert

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
 
B

Bernie Yaeger

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
 
C

Cor Ligthert

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
 
C

Cindy Winegarden

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/downloads/updates/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?
 
C

Cindy Winegarden

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/downloads/updates/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?
 
C

Cindy Winegarden

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.
 
F

Frans Bouma [C# MVP]

Cor said:
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

--
 
F

Frans Bouma [C# MVP]

Cor said:
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

--
 
C

Cor Ligthert

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.
 
C

Cor Ligthert

Frans,

I am always curious when people tell what I have written and don't myself
not know where, so can you show what you mean.

When you are right I have never a problem to make my apoligize.

Cor
 
C

Cor Ligthert

Cindy,

I was afraid to write about crossposting including the fox newsgroups as
well

Because of your message will I next time include that also when it is a
question as now with Bernie. From his message in the language vb newsgroup I
understood that he was directing his question more or less to you, however I
still do not understand how you look to fox messages in the dotNet
newsgroups.

You write in the message in this thread about different audiences, I find
that as well a very important benefit from crossposting, because so we learn
from each others answers, however I keep that mostly out of my messages to
avoid discussions.

By the way what is the most active Fox newsgroup (ADONet), now it took me
some time to find that for Bernie?

Cor
 
F

Frans Bouma [C# MVP]

Cor said:
Frans Bouma,

You are again bringing me in discredited in the newsgroups.
again?

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

I misread your posting and misinterpreted it. So sorry for that
FB
 
B

Bernie Yaeger

Frans, Cor,

You're both very helpful and often - and you're both too intelligent to be
fighting over crossposting!

Bernie
 
B

Bernie Yaeger

Frans, Cor,

You're both very helpful and often - and you're both too intelligent to be
fighting over crossposting!

Bernie
 
C

Cindy Winegarden

Hi Frans,

Bernie "multi"posted - that is, he posted separate messages to each
newsgroup. The suggestion was that "cross" posting would be a better
approach to take than "multi" posting. In short, you and Cor are "on the
same page" not on opposing sides of the issue.

--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
(e-mail address removed) www.cindywinegarden.com


 
C

Cindy Winegarden

Hi Cor,
.... however I still do not understand how you look to fox messages in the
dotNet newsgroups....

I spend a lot of time helping out in newsgroups and I've learned to be
efficient in catching questions that fit my particular skills. I have
several OE accounts. One specifically for FoxPro newsgroups, and one with
more than 100 other Microsoft newsgroups where people might be asking
questions related to FoxPro. (I've also got Beta newsgroups, etc.) I
actually "read" the Fox newsgroups. For the other account I have extensive
OE rules set up to watch threads with certian keywords in the title, and
they show up nicely in blue in the tree on the left side of OE. I get a fair
amount of false positives, but I don't have to read thousands of messages to
find the ones I'm interested in. Of course I don't watch the keywords in the
Fox groups since they are in almost every message.
You write in the message in this thread about different audiences, I find
that as well a very important benefit from crossposting, because so we
learn from each others answers, ....

I started reading newsgroups to learn new things and I've learned incredible
amounts and am now able to give back to the community.
By the way what is the most active Fox newsgroup ...

microsoft.public.fox.programmer.exchange. However, a web-based forum and a
listserv are also popular with Fox folk.
 
C

Cor Ligthert

Cindy,

Clear I understand now how you do that.
That from those 2 accounts is a good trick.
However I think that I answer already more questions than normal in the
dotNet newsgroups.

:)

But I was always curious how you did that and than so selective.

When I saw a message about "Fox" I told everybody to place "Fox" in the
subject. I see now that was and is a good approach to bring it in your
attention.

Thanks,

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top