在Faircom c-Tree Plus中构建查询
本文关键字:构建 查询 Plus Faircom c-Tree | 更新日期: 2023-09-27 18:26:54
我有一个Faircom c树数据库文件(.dat&.idx)。我使用ODBC Faircom驱动程序连接了它。
现在我想在该数据库上构建查询。实际上,我已经准备好了SQL版本查询,但它在c-tree数据库中不起作用。
不支持大多数功能(如isull、isnumeric、dateadd等)
帮我摆脱困境。
这里有一个C#的开发人员指南,您的标签之一是:.Net guide
以及您阅读示例的具体引用:C#读取示例
引用上面链接中的例子,您读取的代码看起来像这样:
static void Initialize()
{
Console.WriteLine("INIT");
try
{
// This section is only needed for the AppServer DLL model.
bool AppServerModel = true;
if (AppServerModel)
{
// Set c-tree database engine configuration file name.
CTSession.SetConfigurationFile("ctsrvr.cfg");
// Start c-tree database engine.
CTSession.StartDatabaseEngine();
}
// allocate objects
MySession = new CTSession(SESSION_TYPE.CTREE_SESSION);
MyTable = new CTTable(MySession);
MyRecord = new CTRecord(MyTable);
}
catch(CTException E)
{
Handle_Exception(E);
}
try
{
// connect to server
Console.WriteLine("'tLogon to server...");
MySession.Logon("FAIRCOMS", "", "");
}
catch(CTException E)
{
Handle_Exception(E);
}
}
static void Display_Records()
{
bool found;
string custnumb;
string custname;
Console.Write("'tDisplay records...");
try
{
// read first record
found = MyRecord.First();
while (found)
{
custnumb = MyRecord.GetFieldAsString(0);
custname = MyRecord.GetFieldAsString(4);
Console.WriteLine("'n't't{0,-8}{1,-20}", custnumb, custname);
// read next record
found = MyRecord.Next();
}
}
catch(CTException E)
{
Handle_Exception(E);
}
}