OutPut the results of a select query to a *.TXT file

J

Joe Mills

i think i'll just take mr. vinson's opinion to heart and not deal with the
hassle of extracted data files. the users have to have some responsibility
right!
i greatly appreciate all the dialog on this issue but it is Saturday, let's
all go and have a beer!

David F Cox said:
I am using 2007 Beta, and have tried it. The original syntax given (despite
looking odd to me) is the only one that works a bit, and only sometimes, for
me. When I say works a bit it will only work for my ID PK field, and ignores
other fields.



Douglas J. Steele said:
Works fine for me.

What's the exact SQL you're trying to run now?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Joe Mills said:
i put in this code: INTO [Text; HDR=Yes; Database=C:\].Archive.txt
it's says it can't find "Archive.mdb"
i'm not trying to save it to another database, it's just supposed to be a
backup .TXT file of the data in the record they are deleting in case they
change their mind after the delete. am i trying to be too nice to the
users?
the deleted data will probably never be needed again.

:

Just try making the suggested change and seeing whether it works.

If it does, you're fine. If it doesn't, post back with what didn't work,
and
we'll see what we can do.
 
D

David W. Fenton

how do the pros like yourself protect your
applications from unauthorized duplication?

I don't. I own the apps or the client owns the apps. The clients
sign agreements that spell out what distributionrights they have
(which is always NONE).
are there copywrite issues i
need to be aware of? i'm obviously a new developer and want to
cover my financial butt. the application i'm writing has the
potential to be sold to literally thousands of institutions
(happened to stumble on a nationwide problem that this will solve)
and i, naturally, want the credit. would i sell it as a license
agreement? if so, your thoughts on fees? thank you for your
interest

You could print the customer name on all reports. In an MDE this
couldn't be changed.

You might want to look at this page:

http://www.frez.co.uk/freecode.htm

and look for the "Create and Validate License Keys." That will allow
you to distribute apps that won't function without a valid license
key from you. I'm working on a way to tie that to the location where
it's installed. Should I work that out, I'll post about it.
 
D

David F Cox

Douglas J. Steele said:
Your original post said you were using INTO [Text; HDR=Yes;
Database=C:\].Archive.txt, but the SQL below has INTO [Text; HDR=Yes;
Database=C:\Archive.txt]

The location of the closing square bracket is important: the folder name
goes inside the square brackets, but the file name is outside (with a
period in front of it)

You may have to put the actual field names in, though. Access will be
creating a file named schema.ini in the same folder as the text file, and
I'm not sure whether it will accept the * instead (sorry, too lazy to
test)
....
FWIW my schema.ini
[Stuff.txt]
ColNameHeader=True
CharacterSet=1252
Format=CSVDelimited
Col1=ID Integer

I had to delete stuff.txt between tests, Access would not overwrite the old
file. It would not overwrite schema.ini either, it just re-used the existing
one without any warning, leading to much bewilderment, as each test produced
the same result.
I have not been able to find any documentation for this writing TXT files
feature. The syntax does not appear natural to me. I suspect that there are
hidden depths to this feature and would like to find a write-up.

Doug Steele, Microsoft Access MVP

(no private e-mails, please)


Joe Mills said:
didn't work for me (see my reply to Mr. Cox)
here's the SQL i'm using:
SELECT Residents.ID, Residents.*, Admission.*, Devices.*, Skin.*,
Property.*, [Physical and Structural].*, Vitals.*
INTO [Text; HDR=Yes; Database=C:\Archive.txt]
FROM (((((Residents INNER JOIN Admission ON Residents.ID=Admission.ID)
INNER
JOIN Devices ON Admission.Key=Devices.Key) INNER JOIN Skin ON
(Devices.Key=Skin.Key) AND (Admission.Key=Skin.Key)) INNER JOIN Property
ON
(Devices.Key=Property.Key) AND (Admission.Key=Property.Key)) INNER JOIN
[Physical and Structural] ON (Devices.Key=[Physical and Structural].Key)
AND
(Admission.Key=[Physical and Structural].Key)) INNER JOIN Vitals ON
(Devices.Key=Vitals.Key) AND (Admission.Key=Vitals.Key)
WHERE (((Residents.ID)=Forms!DeleteResident.ID));


Douglas J. Steele said:
Works fine for me.

What's the exact SQL you're trying to run now?

--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


i put in this code: INTO [Text; HDR=Yes; Database=C:\].Archive.txt
it's says it can't find "Archive.mdb"
i'm not trying to save it to another database, it's just supposed to
be a
backup .TXT file of the data in the record they are deleting in case
they
change their mind after the delete. am i trying to be too nice to the
users?
the deleted data will probably never be needed again.

:

Just try making the suggested change and seeing whether it works.

If it does, you're fine. If it doesn't, post back with what didn't
work,
and
we'll see what we can do.
 
6

'69 Camaro

Hi, David.
I suspect that there are hidden depths to this feature and would like to find
a write-up.

For the syntax in your schema.ini file, you'll find the specifications and
information for using text files with Access on these Web pages:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcjetschema_ini_file.asp

http://support.microsoft.com/default.aspx?scid=155512

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact info.

FWIW my schema.ini
[Stuff.txt]
ColNameHeader=True
CharacterSet=1252
Format=CSVDelimited
Col1=ID Integer

I had to delete stuff.txt between tests, Access would not overwrite the old
file. It would not overwrite schema.ini either, it just re-used the existing
one without any warning, leading to much bewilderment, as each test produced
the same result.
I have not been able to find any documentation for this writing TXT files
feature. The syntax does not appear natural to me. I suspect that there are
hidden depths to this feature and would like to find a write-up.
 
D

David F Cox

Great! Thanks.

'69 Camaro said:
Hi, David.
I suspect that there are hidden depths to this feature and would like to
find a write-up.

For the syntax in your schema.ini file, you'll find the specifications and
information for using text files with Access on these Web pages:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcjetschema_ini_file.asp

http://support.microsoft.com/default.aspx?scid=155512

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact
info.

FWIW my schema.ini
[Stuff.txt]
ColNameHeader=True
CharacterSet=1252
Format=CSVDelimited
Col1=ID Integer

I had to delete stuff.txt between tests, Access would not overwrite the
old file. It would not overwrite schema.ini either, it just re-used the
existing one without any warning, leading to much bewilderment, as each
test produced the same result.
I have not been able to find any documentation for this writing TXT files
feature. The syntax does not appear natural to me. I suspect that there
are hidden depths to this feature and would like to find a write-up.
 
6

'69 Camaro

You're very welcome and have a happy New Year!

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact info.


David F Cox said:
Great! Thanks.

'69 Camaro said:
Hi, David.
I suspect that there are hidden depths to this feature and would like to
find a write-up.

For the syntax in your schema.ini file, you'll find the specifications and
information for using text files with Access on these Web pages:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbcjetschema_ini_file.asp

http://support.microsoft.com/default.aspx?scid=155512

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/expert_contributors2.html for contact info.

FWIW my schema.ini
[Stuff.txt]
ColNameHeader=True
CharacterSet=1252
Format=CSVDelimited
Col1=ID Integer

I had to delete stuff.txt between tests, Access would not overwrite the old
file. It would not overwrite schema.ini either, it just re-used the existing
one without any warning, leading to much bewilderment, as each test produced
the same result.
I have not been able to find any documentation for this writing TXT files
feature. The syntax does not appear natural to me. I suspect that there are
hidden depths to this feature and would like to find a write-up.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top