开发者

Import Excel Files into Powerbuilder

开发者 https://www.devze.com 2023-02-05 19:02 出处:网络
I would like to import an Excel .xls file workbook into Powerbuilder. The file has 2 sheets and these sheets must be imported into 开发者_StackOverflow2 differenct db tables.

I would like to import an Excel .xls file workbook into Powerbuilder. The file has 2 sheets and these sheets must be imported into 开发者_StackOverflow2 differenct db tables.

Any assistance is kindly appreciated.

Thanks

John.


First thing, there's nothing automagic, along the lines of a one-line solution that you could get for other file formats. There's a manual method, there's a scripting approach, and you can probably merge the two as a third option.

For a manual method, you can go into Excel and export your data as something that will import into a DataWindow. You don't mention your PowerBuilder version, but the file format for importing from Excel that comes to mind is CSV, which was added in PB9.

For a scripting approach, you can use OLE (assuming Excel is installed on the client machine) and access data however you want with the scripting engine, moving it into PowerBuilder in whatever format you want.

To mix the methods, you could use OLE to export the file to a couple of CSVs, then dw.FileImport() the data in.

Good luck,

Terry.


Postscript: Sybase has examples of OLE access, and examples of using ODBC, a solution I had neglected before.


If you give names to the areas with the data in Excel and then setup ODBC connections that point to them, you can access them like a database table from within PowerBuilder.

0

精彩评论

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

关注公众号