By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,454 Members | 1,804 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,454 IT Pros & Developers. It's quick & easy.

Transfertext Specification Name *.ini

P: n/a
Hi,
I'm exporting data from MSAccess to a *.txt file using VBA. I have
already set up specification to TAB delimited, no Commas for Text and
saved it ( .. in File>Export, etc)

The problem is that current Database can be opened from different
computers. Instead of setting Specification names on each computer,
help file says that it's possible to create and *.ini file to extract
specification name directly from it.

My question is how to create this file? Which is the structure /
parameters for this file?

I've been digging around but haven't find an answer on MSAccess groups.
Regards,
LC

Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Instead of using TransferText you can write directly to a text file.
This is actually more reliable that TransferText:

Sub TabDelimTxtFile()
Dim DB As DAO.Database, RS As DAO.Recordset
Dim strPath As String, i As Integer

Set DB = CurrentDb
Set RS = DB.OpenRecordset("tblToExport")
Do While Not RS.EOF
For i = 0 to RS.Fields.Count - 2
str1 = str1 & RS(i) & vbTab
Next
str1 = str1 & RS(i) & vbCrLf '--get last field -no tab
RS.MoveNext
Loop
RS.Close
strPath = Left(DB.Name, Len(DB.Name) - Len(Dir(DB.Name))
Open strPath & "TabTxt.txt" For Output As #1
Print #1, str1
Close #1

End Sub

This routine will loop through your table and write the fields with a
tab delimeter for each field and a linefeed cariage return at the end of
the row to a string var. Then you write that string var to your text
file. This text file can be opened in Excel as a tab delimited file.

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Nov 13 '05 #2

P: n/a
Br
ca******@yahoo.com wrote:
Hi,
I'm exporting data from MSAccess to a *.txt file using VBA. I have
already set up specification to TAB delimited, no Commas for Text and
saved it ( .. in File>Export, etc)

The problem is that current Database can be opened from different
computers. Instead of setting Specification names on each computer,
help file says that it's possible to create and *.ini file to extract
specification name directly from it.

My question is how to create this file? Which is the structure /
parameters for this file?

I've been digging around but haven't find an answer on MSAccess
groups.
Regards,
LC


The specification should be saved with the database so it should be
available to all users using it???
--
regards,

Bradley

A Christian Response
http://www.pastornet.net.au/response
Nov 13 '05 #3

P: n/a
You can import the specification from one database to another, if for some
reason you have the specification in just one file. Use File | Get External
Data | Import, and when the wizard window opens, click the Options button to
see a checkbox for the Import/Export specifications.

--

Ken Snell
<MS ACCESS MVP>

<ca******@yahoo.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Hi,
I'm exporting data from MSAccess to a *.txt file using VBA. I have
already set up specification to TAB delimited, no Commas for Text and
saved it ( .. in File>Export, etc)

The problem is that current Database can be opened from different
computers. Instead of setting Specification names on each computer,
help file says that it's possible to create and *.ini file to extract
specification name directly from it.

My question is how to create this file? Which is the structure /
parameters for this file?

I've been digging around but haven't find an answer on MSAccess groups.
Regards,
LC

Nov 13 '05 #4

P: n/a
Thks for your responses.

Where can I find a template/structure for the *.ini file?

Regards,
LC

Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.