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

WRITE #1 to a text file - MEMO fields

P: n/a
I am using the following for writing to a file some data:

Open var_export_file For Output As #1

Write #1,.......

One of the values I want to write to the file comes from a MEMO file.
Only 255 characters are written from the memo field, the rest are
invalid characters.

Is there a simple solution for this ?
Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Sep 01 2004, 05:13 am, cl*****@memrb.com.cy (CLarkou) wrote in
news:db*************************@posting.google.co m:
I am using the following for writing to a file some data:

Open var_export_file For Output As #1

Write #1,.......

One of the values I want to write to the file comes from a MEMO file.
Only 255 characters are written from the memo field, the rest are
invalid characters.

Is there a simple solution for this ?


Try using Put instead of Write. If that doesn't help, post the actual code
you are using.

--
remove a 9 to reply by email
Nov 13 '05 #2

P: n/a
I checked in help for PUT command, but it should be used for binary or
random files.

This is the code I am using: (The Alias_descr field is a memo field)

Set db_query = db.QueryDefs("select_items")

Set db_set = db_query.OpenRecordset()
Set db_query = Nothing

Open var_export_file For Output As #1

Do While Not db_set.EOF
Write #1, db_set![dimension_no], db_set![Level_no],
db_set![Alias_descr], db_set![Heading_Title], db_set![calculated]

db_set.MoveNext
Loop

Set db_set = Nothing

Close #1


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #3

P: n/a
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Don't do this "db_query = Nothing" until after the loop, 'cuz db_set
refers db_query QueryDef. I've found its best to clean up (set =
nothing) only at the end of the routine.

Use Print #1 when exporting just text.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQTZfoIechKqOuFEgEQLgKwCgyht5htLu6puCOjiBVMxRBL VCE5oAoKZj
JZAf3pF7aR4LlETtBn9P5I1X
=Oo4M
-----END PGP SIGNATURE-----
Christina Larkou wrote:
I checked in help for PUT command, but it should be used for binary or
random files.

This is the code I am using: (The Alias_descr field is a memo field)

Set db_query = db.QueryDefs("select_items")

Set db_set = db_query.OpenRecordset()
Set db_query = Nothing

Open var_export_file For Output As #1

Do While Not db_set.EOF
Write #1, db_set![dimension_no], db_set![Level_no],
db_set![Alias_descr], db_set![Heading_Title], db_set![calculated]

db_set.MoveNext
Loop

Set db_set = Nothing

Close #1


Nov 13 '05 #4

P: n/a
Thanks for the tip for db_query=nothing. I am using WRITE because of the
several universal assumptions that follows. Print has the same problem
as Write for MEMO fields.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.