Access Link Text Wizard - Syntax error in PARAMETER clause - ms-access

I'm trying to link to a text file from the Access Link Text Wizard (as I've successfully done hundreds of times before) but this time I'm getting an error stating
Syntax error in PARAMETER clause.
No parameterized query is being used so I'm at a bit of a loss, I'm only trying to link to a text file.
In Access 2016 I go to the External Data tab and click Text File. I browse to my tab-delimited text file and select the Link to the data source creating a linked table option. As soon as I click OK it gives me the error above.
My text file is very simple with 2 columns and about 100 rows of data. This file is created from a Stored Procedure in SQL Server 2016 using BCP. If I manually create a text file with test data using the same format I don't get the error, which leads me to believe it may be some data in the file causing the error? I can't figure out how to attach text files to my question so any suggestions are welcome.
EDIT: I copied all data from the offending file into a new text file and it linked properly so it's not the data. I am often creating text files from a SQL Server Stored Procedure then linking to it from Access. This is the first time I've experienced this particular error.
EDIT2: I recreated a text file manually with the same data from the offending file and named it the same this time (Procedure Class Listing.txt) and I got the error. Is something wrong with this title???
EDIT3: Sorry for so many edits. I tried naming the file without the spaces and it links properly. I have linked to files with spaces in the name before so I don't understand.
FINAL EDIT: So it appears that a text file starting with the word "Procedure" followed by a space is giving me this error. I can remove all spaces (ProcedureClassListing.txt) and it works fine (which is the solution I'm going with).

So it appears that a file starting with the word "Procedure" followed by a space is giving me this error. I can remove all spaces (ProcedureClassListing.txt) and it works fine (which is the solution I'm going with).

Related

"Text was truncated or one or more characters had no match in the target code page."

this might be a really old question, but I am getting this error using a SSIS package that someone created, I checked the error and it seems that a column from the flat file that the package is reading has a lot of blank spaces or maybe tabs that make the field longer that it should be.
1.- I tried to change the outputcolumnwidth from 50 to 100 or + but it is not working.
2.- I search on this page but all make reference to csv files or add an step creating an xls files, but I need to see if is possible to solve it without doing it because another option that I though was to remove the file from reading it.
any advice is appreciated...

SSIS Handling a Flat File Missing a Text Qualifier

I'm currently designing as SSIS package to import some CSV files and needs to account for various error types. One of the errors is an incorrect or missing text qualifier.
I.E: "col1","col2","col3/,"col4"
The package is currently throwing the error "[ProductMaster CSV [66]] Error: The column delimiter for column "Column 2" was not found.".
Which is what I would expect to see in this situation.
Apparently getting the file initially sent in the correct format isn't an option at the moment.
I've tried changing the file to have no text qualifier, but this then falls over if there is a comma in a field so is not a viable solution.
Is there any way of handling this?
I use a third party tool to read csv files and it handles this type of situation. If you must do something on your own I would import the entire line to one column and then parse it with either a stored procedure or a script component.
There are plenty of solutions out there, some free and some with a minimal cost.
I have never found a way to handle this with SSIS connection managers 'out of the box'.
To solve this issue, look at your file format. Use text editor like Notepad++ and if your file is CR, make sure you don't use (") instead choose in the text qualifier and choose CR in the header row. This should work 100%

Importing text file to Access database in Windows 7

I am trying to import data from a text file to Access 2007 and 2010, delimited by vertical bar. I use Import Text Wizard of MS Access, but when I try to import it after choosing appropriate delimiter (preview looks fine), I get the following error:
The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again.
There are no primary keys, nor relationships, as it is just a text file. I was able to insert this text file in Windows XP, but the problem arises in Windows 7. I was able to successfully export the data into Excel. I also set Indexed to No in Field Options of Import Text Wizard, but that didn't help either.
Any help would be greatly appreciated, as I couldn't find any useful info anywhere.
Edit: I tried inserting into new and existing tables, even a new database (accdb and mdb format), every time I get the same error.
Edit2: I opened the text file in WordPad, and saved it again as txt file, the Access didn't generate any error. The previous txt file didn't show the new lines, but Access was still aware where each record ends, and preview looked fine. The new text file specifically shows new lines (each record separately). If someone has a suggestion about how to overcome this issue without creating a new txt file, please let me know
I don't think there is anything you can do except convert the file to Windows CRLF format.
Although I wouldn't use WordPad for this, but Notepad++.
It has an explicit command for this: Edit -> EOL conversion, and you can be fairly sure that it won't change anything else in your file (I wouldn't be so sure about WordPad).
Actually most text editors that are more sophisticated than Notepad have a command for this, I think. :)

SSIS Package not reading the last row in flat file

I have SSIS Package which will load .EXT file into my Database table.
The package Flat File connection manager Editor properties are
Format: Ragged Right
Code Page: 1252 ANSI (Latin-I)
Text Qualifier: <None>
Header Row Delimiter: <LF>
While trying to preview the file before loading, i am able to see all the rows in columns and
preview tab of Flat File connection manager Editor.
But in actual loading of the file, last record alone is not getting imported into table.
It was loading fine and still it is processing the file on daily basis.
Only for two days file, it was not imported last records. I am trying to find the root cause.
I suspected something wrong with the file, but i do not find any differences between the
working and not-working version of files.
Please suggest us to resolve the same. Kindly let me know if any informations required.
I ran into the same issue and did some research to find a solution that worked from me. Apparently the SSIS package had gone through a conversion from an earlier version at one point. When the conversion was done, the text qualifier property on the flat file connection was mangled. It had originally been <none>, but the conversion changed it to _x003C_none_x003E_. I opened the flat file connection manager and changed the text qualifier property on the general tab back to the proper value of <none>.
Credit goes to this thread for providing the answer.
I had a similar issue. My flat file didn't had any text qualifiers. When i added a text qualifier the package ran successfully. My guess is that the file is read as text and the CRLF is not recognized at the last line.
If you can provide a sample of the data from the file

MySQL Workbench 6.1 - Error importing recordset

I'm going to be getting a new computer soon and I don't want to lose all of the data I have entered in my tables, so I decided to test out the feature that allows you to export and import CSV files. I exported a table successfully (data was transferred to Microsoft Excel in CSV file), but when I opened the file in Microsoft Excel and added a few rows and tried to import it back in to MySQL Workbench, I got the following error:
"Error importing recordset
error calling Python module function
SQLIDEUtils.importRecordsetDataFromFile"
I've searched all over for info on this, but can't find any solutions. Does anyone know what I'm doing wrong?
In Workbench, open a MySQL connection and then navigate to [Server] --> [Data Export]. There are several backup options here, including saving the data as an individual file or folder. Choose the databases you want to export, and then click [Start Export].
If you ever prefer using Excel for editing and such, then use the MySQL for Excel plugin to access MySQL databases from within Excel. However, I don't think you need it here.
To export your mySQL data, use mysqldump, which will create all the schema for you.
Excel probably added some stuff to your file and now mySQL can't understand it. The best way to find out is by comparing the files before and after the change.
That error indicates a format problem. If the file is small enough, try opening it in wordpad (or the mac equivalent) and see if there's any difference in the formatting? Could be that the delimiting got a little messed up (this can happen especially with end of row markers in MySQL, I've noticed, it can also happen in mac to pc handoffs). If all else fails you could try exporting using a different format and see if that makes a difference (maybe tsv) when you add new rows.
Another reason can be the line endings used. Depending on the system and editor used to work with the cvs file it the line endings might get changed. For me mysql supported UNIX line endings. And in the editor the line ending had been set to MAC OS 9 since I was using a MAC.
Changing it to UNIX line ending worked.
I found that it might be due to a wrong encoding of the input file.
Using Notepad++ for example (or another similar editor) you need to change file encoding to UTF-8.