在不创建ODBC DSN的情况下读取Pervasive Database 9 [英] Read Pervasive Database 9 without creating ODBC DSN

查看:121
本文介绍了在不创建ODBC DSN的情况下读取Pervasive Database 9的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用C#(.NET 4.0)编写一个应用程序,该应用程序必须与另一个更旧的应用程序集成.部分要求是我的程序必须从三个Btrieve文件中读取数据.我可以假定这些Btrieve数据文件将在安装程序的计算机上已经存在,并且还可以假定还将安装Pervasive PSQL V9并运行关系和事务服务程序.

I am writing an application in C# (.NET 4.0) which has to integrate with another, much older application. Part of the requirement is that my program must read data from three Btrieve files. I can assume that these Btrieve data files will already exist on the computers where my program is installed, and I can also assume that Pervasive PSQL V9 will also be installed and the relational and transactional service programs are running.

我有关联的DDF文件,可以将它们安装为应用程序的一部分.它们的创建方式必须将它们放在Btrieve数据文件所在的其他目录中. (它们必须是数据文件所在目录的子目录).

I have the associated DDF files, and I can install them as part of my application. The way they were created I have to put them in a different directory to where the Btrieve data files are. (They have to be a sub-directory of the directory where the data files are).

开始时我对Pervasive或Btrieve一无所知,但经过一些试验,我可以使用32位ODBC管理工具创建DSN,并且可以从数据中读取使用ODBC ADO连接器的文件.到目前为止一切都很好.

I didn't know anything about Pervasive or Btrieve when I started, but after a bit of experimentation I have got to the point where I can create a DSN using the 32 bit ODBC administration tool, and I can read from the data files using the ODBC ADO connector. All good so far.

我的问题是,是否可以从我的.NET程序中读取这些文件,而不必在计算机上创建ODBC DSN?换句话说,是否可以在ODBC连接字符串中指定* .DAT文件所在的目录和* .DDF文件所在的目录?

My question is, is it possible to read from these files from my .NET program without having to create an ODBC DSN on the machine? In other words, is it possible to specify the directory where the *.DAT files are and the directory where the *.DDF files are in the ODBC connection string?

我不致力于使用ODBC,我很高兴使用OLEDB或任何其他允许使用.NET可靠地从这些文件读取的技术.

I'm not committed to using ODBC, I'm happy to use OLEDB or any other technology that allows me to reliably read from these files using .NET.

推荐答案

尽管无DSN的连接允许您在没有DSN的情况下进行连接,但是您仍然需要一个数据库名称.可以使用 DTO .使用C#,我建议使用DTO.
如果无法创建数据库名称,则可以使用OLEDB.它支持使用连接字符串的Data Source参数中的路径,如

While a DSN-less connection allows your to connect without a DSN, you would still need a Database Name. Pervasive Database Names can be created on the fly using DTI or DTO. Using C#, I would suggest DTO.
If you can't create a Database Name, you can use OLEDB. It supports using a path in the Data Source parameter of the connection string as documented in the Remote Connections section of the OLEDB documentation.

另一个警告,请确保将.NET程序编译为x86而不是AnyCPU.普及型OLEDB提供程序只有32位.如果将应用程序安装在编译为AnyCPU的64位操作系统上,它将寻找64位提供程序并失败.

One more caveat, make sure to compile your .NET program as x86 and not AnyCPU. The Pervasive OLEDB provider is only 32 bit. If you install your app on a 64 bit Operating System compiled as AnyCPU, it will look for a 64 bit provider and fail.

这篇关于在不创建ODBC DSN的情况下读取Pervasive Database 9的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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