How to get columns of DBF file in my VC++ application - visual-c++

I have problem to Get columns of DBF file in my vc++ application.
I used SQLColumns() to get Columns List.
but it giving SQL_NO_DATA as result.
what can i do, it happens only for One DBF file. if i create sample DBF file it perfectly worked,
Please give me suggestion,
Thanks in Advance.

I see you're using ODBC. The VFP ODBC driver works only with VFP 6 and earlier data files. Maybe the file you're having trouble with was created using features added in a later version of VFP?

Related

Talend 7.1 tFileOutputExcel corrupt file

I'm trying to output an excel file from Talend 7.1. I've tried a few different setups and both xls and xlsx formats but they all result in the output file being corrupt and not being able to open it.
What am I doing wrong? I am loading an xlsx file into a database and this part works fine but outputting to excel I just can't figure it out! I was writing from the tMap directly to the tFileOutputExcel and it wasn't working (corrupt) so I changed it to write to a csv file first and then write that csv to the tFileOutputExcel but it is still corrupt.
This is my job detail:
And this is the settings in the tFileOutputExcel
I got this working by changing the transfer mode in the FTP component from 'ascii' to 'binary'. Such a simple thing but if this helps anyone else with this issue who is a newb like me :)

Why is the Addon XLSX not working for the following code in my system?

I am trying to access two excel files that are opening using Excel Viewer but when I use the G1ANT Studio it says the files are corrupted.
Code-
addon xlsx version 4.101.0.0
addon core version 4.101.0.0
addon language version 4.103.0.0
xlsx.open path C:\Users\joshs\Desktop\File1.xls result ♥xlsId1
xlsx.open path C:\Users\joshs\Desktop\File2.xls result ♥xlsId2
xlsx.close id ♥xlsId2
Try using .xlsx format instead of .xls format.

Package executed in Visual Studio cancels without helpful error

I am following a Udemy Course Learn ETL using SSIS. The first simple task is to transfer data from an excel file to a database.
The only change I have made is I am trying to transfer to a PostgreSQL server instead of a Microsoft SQL Server. I therefore had to install SSDT for Visual Studio first, and get the ODBC driver necessary to create a ODBC Destination for the package.
All well so far, but then when I try and run the package I just get:
SSIS package "Visual Studio 2017\Projects\Excel_SQL\Excel_SQL\Package.dtsx" starting.
Information: 0x4004300A at Excel to SQL, SSIS.Pipeline: Validation phase is beginning.
Information: 0x4004300A at Excel to SQL, SSIS.Pipeline: Validation phase is beginning.
Information: 0x40043006 at Excel to SQL, SSIS.Pipeline: Prepare for Execute phase is beginning.
Information: 0x40043007 at Excel to SQL, SSIS.Pipeline: Pre-Execute phase is beginning.
Information: 0x4004300C at Excel to SQL, SSIS.Pipeline: Execute phase is beginning.
SSIS package "Visual Studio 2017\Projects\Excel_SQL\Excel_SQL\Package.dtsx" finished: Canceled.
The program '[14368] DtsDebugHost.exe: DTS' has exited with code 0 (0x0).
No data transfers over. The excel file is very simple, excel 97-2003 as the connection expects, contains 2 columns only, rollnumber and marks, rollnumber has 11 rows of data going 1 to 11, and then some random marks in the marks column.
My database on Postgres is set up with these 2 columns, as numeric types.
I really cannot figure out what is going wrong.
I have seen some similar questions on stack overflow, but that was around the file type not being correct:
SSIS Package Cancels instantly on Debug
I don't think that's my issue.
Can anyone please advise?
Thank you.
I think the situation is not clear, but there are many suggestions that you can follow:
(1) Try to run the package in 32-bit
The issue may be caused if the package is trying to run in 64-bit mode and you don't have installed the relevant references, try to execute the package in 32-bit mode:
Package Properties >> Debugging >> Run64BitRuntime = false
How to execute a 32 bit SSIS package in a 64bit package?
(2) AccessDatabaseEngine is not installed
The issue may be caused if the Office connectivity components for microsoft Excel are missing, check that you have installed them:
Microsoft Access Database Engine 2010 Redistributable
Microsoft Access Database Engine 2016 Redistributable
(3) Make sure you have followed the appropriate steps to create ODBC Destination
You can follow this article in order to create a package that import data to postgres, check that all steps are done correctly:
SSIS WITH POSTGRESQL : CONNECT TO POSTGRESQL WITH SSIS COMPONENTS
(4) Doing some workarounds
In order to specify the error source, try to replace the Postgres destination with a Flat File Destination, if the package is executed successfully then the problem is with the ODBC Destination, also try to replace the excel source with FLat File Source, if the package is executed successfully then the problem is with the Excel Source.
If you are new to SSIS, som articles can help:
Simple SSIS: Importing Data from Flat Text Files
Export Data from SQL Server to Flat File in SSIS Example
Using SSIS to Export Data to Flat Files
(5) Try to Use SQL Import Export Wizard
If you have SQL Server Installed, try to use the Excel Import Export wizard to create and execute the package:
Import and Export Data with the SQL Server Import and Export Wizard
Connect to a PostgreSQL Data Source (SQL Server Import and Export Wizard)
How to export data from SQL Server to a Flat file
So, in this case it was that I just had to move the (Source) excel file out to my E:\ drive. Perhaps the path it was in was too long? Only 3 folders in from E:\ but...it worked.
Can anyone explain why that was the issue? Nothing pointed to that from the error messages.

What .xlsx file format is this?

Using an existing SSIS package, I was trying to import .xlsx files we received from a client. I received the error message:
External table is not in the expected format
These files will open in XL
When I use XL (currently XL2010) to Save As... the file without making any changes:
The new file imports just fine
The new file is 330% the size of the original file
When changing .xlsx to .zip and investigating the contents with WinZip:
The original file only has 4 .xml files and a _rels folder (with 2 .rels files):
The new file has the expected .xlsx contents:
Does anyone know what kind of file this could be?
It would be nice to develop my SSIS package to work with these original files, without having to open and re-save each file. There are only 12 files, so if there are no other options, opening/saving each file is not that big of deal...and I could automate it with VBA going forward.
Thanks for any help anyone can provide,
CTB
There are many Excel file formats.
The file you are trying to import may have another excel format but the extension is changed to .xlsx (it could be edited by someone else) , or it could be created with a different Excel version.
There is a Third-Part application called TridNet File Identifier which is an utility designed to identify file types from their binary signatures. you can use it to specify the real extension of the specified file.
Also after a simple search on External table is not in the expected format this error is thrown when the definition (or version) of the excel files supported in the connection string is different from the file selected. Check the connection string used in the excel connection manager. It might help to identify the version of the file.

Perl reading XLSX embeded documents

First post here so if I am doing something stupid, please let me know.
CentOS 7(3.10.0-123.6.3.el7.x86_64), perl5 (revision 5 version 16 subversion 3), Spreadsheet::ParseXLSX v0.16
I have an .xlsx that has some embedded .pdf's and another xlsx in embedded within it. I am trying to read these and insert them into a csv along with the original xlsx. After some googl'ing to no avail my thought was to unzip the original xlsx and read the files from the xl/embeddings directory but, alas there is something with the file that causes adobe reader to not be able to read the oleObject(X).bin files in that dir.
I have been able to successfully read all the worksheets that dio not contain embedded docs using Spreadsheet::ParseXLSX, works great. I have googled for a solution but am either not using correct search prams or ...
If you know how to do this can you point me to some instructions?
TIA,
JohnM

Resources