Bobby
asked on
Access 2003, modify export spec
I have a saved export spec that I need to modify. I need to make one of the fields a memo instead of just text. The source table is definitely memo and storing the data correctly. I changed the table data type after I had already saved the spec.
I went in to use the export spec so I could tweak it and re-save, but nowhere does it give me options to specify data types. How to?
I went in to use the export spec so I could tweak it and re-save, but nowhere does it give me options to specify data types. How to?
ASKER
File format is .txt, tab delimited.
Yes, that field's data is being truncated at 255.
Yes, that field's data is being truncated at 255.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Is the export being made from a table or via a query?
Kelvin
Kelvin
ASKER
There was already a memo field in the same table when I created the spec, and it IS making it into the txt file intact, so the spec is definitely accounting for the fact that it's a memo field. It's just that after I changed a different field from text to memo, after I had already saved the spec, that field is still being exported as text 255.
Export is being done via code:
Export is being done via code:
txtExportName = "C:\AmazonFeeds\data.txt"
DoCmd.TransferText acExportDelim, "AmazonInventoryCreateData", "Data2", txtExportName, True
' If an error occurs, close the files and end the macro.
On Error GoTo ErrHandler
' Open the destination text file.
DestNum = FreeFile()
Open "C:\AmazonFeeds\feed.txt" For Append As DestNum
' Open the source text file.
SourceNum = FreeFile()
Open "C:\AmazonFeeds\data.txt" For Input As SourceNum
' Include the following line if the first line of the source
' file is a header row that you do now want to append to the
' destination file:
' Line Input #SourceNum, Temp
' Read each line of the source file and append it to the
' destination file.
Do While Not EOF(SourceNum)
Line Input #SourceNum, Temp
Print #DestNum, Temp
Loop
CloseFiles:
' Close the destination file and the source file.
Close #DestNum
Close #SourceNum
DoCmd.Hourglass False
MsgBox "Done"
Exit Sub
you do not get to choose data type in specs -- only field delimiters (such as comma) and text delimiters (such as ", ', or {none}), or if it is fixed width, the start column and field width along with field name
I suspect the memo column that is working ok actually has <=255 characters
I suspect the memo column that is working ok actually has <=255 characters
ASKER
I confirmed that the finished file has way more than 255 from that pre-existing memo field. So the pre-existing one IS exporting as memo for sure.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I figured it out... I had to create a totally new one instead of just trying to save the existing one as I exported. Obviously something in Access backend that holds that table name to the original spec and you don't get to alter it no matter what the table data types are now. So, I created a whole new spec, plugged the new spec name into the code, and it works fine.
ASKER
Both of the comments I selected were valid solutions to the end result.
glad you got it ~
Is the data being truncated?
What is the format of the export file?