改变vfp的.cdx指数 [英] altering .cdx indices for vfp

查看:96
本文介绍了改变vfp的.cdx指数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的客户有一个他希望我加入的视觉foxpro应用程序。我是通过带有这个连接字符串的odbc连接到它的


Dim oconn_d As New OdbcConnection(" Driver = {Microsoft Visual FoxPro

Driver}; SourceType = DBF; SourceDB = c:\ test; exclusive = NO")

这些是独立的表,都带有.cdx文件。我不拥有也不是我

打算使用vfp来处理这个问题;相反,我正在使用它在vb .net中专门使用
。为了显示数据,我没有问题;但是,如果他想让我修改数据,那么这需要改变.cdx,这可能是使用vfp自动发生的,而不是odbc。我能做什么

通过odbc访问它们时更新.cdx文件?


Tx获取任何帮助。


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


推荐答案

伯尼,


你试试它已经在新闻组中了


microsoft.public.fox.helpwanted


也许在这个VBNet新闻组中看到Cindy你的消息但是可能
那里
更快。而且我以为我曾经在Foxpro看到那里有新的

供应商。


Cor
Bernie,

Dit you try it already in the newsgroup

microsoft.public.fox.helpwanted

Maybe sees Cindy your message in this VBNet newsgroup however probably
faster there. And I thought that I had seen that there everytime new
providers for Foxpro.

Cor


嗨Cor,


我期待听到Cindy的消息。不,我没有尝试fox.helpwanted,但

tx的想法 - 我现在将在那里发布。


再次感谢,


伯尼


" Cor Ligthert" <无************ @ planet.nl>在消息中写道

news:uV **************** @ TK2MSFTNGP09.phx.gbl ...
Hi Cor,

I was expecting to hear from Cindy. No, I did not try fox.helpwanted, but
tx for the idea - I will post there now.

Thanks again,

Bernie

"Cor Ligthert" <no************@planet.nl> wrote in message
news:uV****************@TK2MSFTNGP09.phx.gbl...
Bernie,

你已经在新闻组试试了它

microsoft.public.fox.helpwanted

也许在这个VBNet新闻组看到Cindy你的消息然而可能<那里更快。而且我认为我每次都有新的供应商为Foxpro看过。

Cor
Bernie,

Dit you try it already in the newsgroup

microsoft.public.fox.helpwanted

Maybe sees Cindy your message in this VBNet newsgroup however probably
faster there. And I thought that I had seen that there everytime new
providers for Foxpro.

Cor



嗨Bernie,


以下在VB 2003中运行正常:
Hi Bernie,

The following works just fine in VB 2003:


选项明确的

选项严格


进口系统

进口System.Data

进口系统。 Data.OleDb

模块模块1

Sub Main()

尝试


'' - 下载并安装最新的VFP OLE DB数据提供程序

'' - 来自
http://msdn.microsoft.com/vfoxpro/do...s/default.aspx


'' - FoxPro代码:

'' - 创建表C:\ Temp \ TestIndex Free(FirstName C(10),

LastName C(10) )

'' - LastName + FirstName Ta上的索引g FullName


Dim conn As OleDbConnection

conn =新OleDbConnection(" Provider = VFPOLEDB.1; Data

Source = C:\ Temp;")

conn.Open()


'' - 让我们创建一些数据来使用

Dim cmd1 As New OleDbCommand(Insert Into TestIndex Values('''',

''B'')",conn)

Dim cmd2 As New OleDbCommand(" Insert Into TestIndex Values(''X'',

''Y'')",conn)

Dim cmd3 As New OleDbCommand (插入TestIndex值(''F'',

''G'')",conn)

cmd1.ExecuteNonQuery()

cmd2.ExecuteNonQuery()

cmd3.ExecuteNonQuery()


'' - FoxPro代码:

' ' - 使用C:\ Temp \ TestIndex订单FullName


'' - 命令结果:

'' - 名字姓氏

'' - AB

'' - FG
'' - XY

Catch ex As Exception

MsgBox(ex.ToString())

结束尝试


End Sub

结束模块

<<


为什么不呢使用FoxPro和Visual FoxPro OLE DB数据提供程序?

您确定使用的是CDX索引而不是IDX索引吗?

索引是否具有与相应表相同的名称?

表上的索引表达式究竟是什么?是否有任何

用户定义的函数等?

是否修改数据是否包含插入/删除/更新数据以外的其他内容?

-

Cindy Winegarden MCSD,Microsoft Visual FoxPro MVP
ci ************** @ msn.com www.cindywinegarden.com

" Bernie Yaeger" <是***** @ cherwellinc.com>在消息中写道

新闻:%2 **************** @ tk2msftngp13.phx.gbl ...我的客户有一个他想要的视觉foxpro应用程序我要陷入困境。我是通过odbc连接到这个连接字符串:
Dim oconn_d As New OdbcConnection(" Driver = {Microsoft Visual FoxPro
Driver}; SourceType = DBF; SourceDB = c: \ test; exclusive = NO")

这些是独立的表格,都带有.cdx文件。我不拥有也不做
我打算用vfp来处理这个问题;相反,我正在使用它专门在vb .net内部。为了显示数据,我没有问题;但是,如果他要我修改数据,这需要改变.cdx,这可能是使用vfp自动发生的,但不是odbc。通过odbc访问时,我可以做些什么更新.cdx文件?

Tx提供任何帮助。

Bernie Yaeger

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
ci**************@msn.com www.cindywinegarden.com
"Bernie Yaeger" <be*****@cherwellinc.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl... 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



这篇关于改变vfp的.cdx指数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆