开发者

Delphi 7, TTable, Csv file fields

HI, My Question may be a simple one for you.

I have to import a csv file to my delphi application. This file contains 3 columns and I want to match the columns to one of Dataset( TQuery connected to a Firebird table) and show on a grid.

My Question is, is it possible to use the Csv file as a table, who can access by a SQL query and join to a Db table ?

I have tried with TTable with TableType property as ttASCII. It loads the file.However this loads the contents to a single fields, ie, Fields[0].asstring gives '11,12,abc.txt' I want this on different fields ie, Fields[0].asstring = '11' Fields[1].asstring = '12' Fields[3].asstring = 'abc.txt'

Hope you understand my requirement. Kindly take a look and let me know your thoughts

Thanks and Regards,

Vijesh V.Nair

System Analyst开发者_C百科


Vijesh , you have to create a schema definition file to access a txt file from a TTable component, the name of the schema file must the same of the text file but with the SCH extension. in this link you can found more information about the format of the schema file Using The ASCII Driver With Comma-delimited Files, also you can check the BDE32.HLP file.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜