|
-
Jan 3rd, 2005, 12:42 PM
#1
Thread Starter
Frenzied Member
Change default delimiter in Access [Resolved via impossibility]
Is it possible to change the default delimiter from a comma to a pipe in Access? I want to create tables on the fly based on text files with different numbers and names of fields, but they're delimited by the pipe symbol. I don't want to create these by hand and then create import specifications for each one. Thanks.
Last edited by salvelinus; Jan 3rd, 2005 at 05:13 PM.
Tengo mas preguntas que contestas
-
Jan 3rd, 2005, 02:08 PM
#2
Re: Change default delimiter in Access
One way to do it would be to create a macro that would do a 'Transfer Text'
action with 'Import Delimited' as the transfer type. Also, create and save
a 'Specification' for importing the file (this is the same steps you go through
when setting up a file import. You get to specify the delimiter, etc.). Then
when you run the macro it can import your files using your pre-choosen
delimiter.
HTH
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 3rd, 2005, 03:19 PM
#3
Thread Starter
Frenzied Member
Re: Change default delimiter in Access
How would I create a specification that isn't linked to a pre-existing table? I tried creating a macro, but it wanted the specification name, the table name to import to (there isn't one yet - it gets created, and it's different for each text file), and it wanted the name of the text file to import from (this is user chosen each time). Maybe I don't understand macros that well, rarely if ever use them. This would work - if commas were the delimiter in the text file:
VB Code:
'this will create a table named tblAnyNameIGiveIt from whatever comma delimited
'text file the user chooses
DoCmd.TransferText acImportDelim, , "tblAnyNameIGiveIt", "c:\UserSelected.txt", True
but I can't get the delimiter argument after acImportDelim to accept the pipe symbol.
Tengo mas preguntas que contestas
-
Jan 3rd, 2005, 03:25 PM
#4
Re: Change default delimiter in Access
Yes, since you dont have the table ahead of time you can not create a specification
either. Looks like you may just need to create a loop reading in the file and
adding records to the table all in code.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 3rd, 2005, 05:11 PM
#5
Thread Starter
Frenzied Member
Re: Change default delimiter in Access
Well, thanks anyway. I don't know why MS doesn't give this option. It should be trivial to allow any character as a delimiter in TransferText. 
At least Split() is available.
Tengo mas preguntas que contestas
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|