Double Quote marks duplicated when outputting text to file

J

jon

Hi,
I want to export a list of customer accounts into a Google KML file, so that
clicking on the file will show all their locations on google earth.

I have managed to generate the correct format of the KML file using a
function I have created in Access97, and the output of the function is
perfectly accurate.

I have then saved the output to a text file ( but added a KML extension) ,
but during the output stage, double quotations are added at the beginning
and at the end of the functions content, and in addition any double
quotations that existed within the string are repeated.

For example
The first line should read
<?xml version="1.0" encoding="UTF-8"?>

But it actually exports as
"<?xml version=""1.0"" encoding=""UTF-8""?>

Here's how I create my KML file using my function

Open "C:\Users\JON.DONKEYNOB\Desktop\GOOGLE_EARTH" & [txt_type] & ".KML"
For Output As #1
Write #1, GENERATE_GOOGLE_EARTH_LOCATIONS([txt_type])
Close #1


The variable txt_type is just a way that my function knows if I want to
export live customers or potential customers from our sales

Any help appreciated.

Jon
 
J

John Spencer

Try using Print instead of Write

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
 
J

jon

Thats fantastic John,
Thanks for your help.

I now have to replace some & characters within my script with + symbols
(because I've found that Google doesn't like the & symbol.

Any ideas how to do a find and replace within my function ?


Jon

John Spencer said:
Try using Print instead of Write

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
Hi,
I want to export a list of customer accounts into a Google KML file, so
that clicking on the file will show all their locations on google earth.

I have managed to generate the correct format of the KML file using a
function I have created in Access97, and the output of the function is
perfectly accurate.

I have then saved the output to a text file ( but added a KML extension)
, but during the output stage, double quotations are added at the
beginning and at the end of the functions content, and in addition any
double quotations that existed within the string are repeated.

For example
The first line should read
<?xml version="1.0" encoding="UTF-8"?>

But it actually exports as
"<?xml version=""1.0"" encoding=""UTF-8""?>

Here's how I create my KML file using my function

Open "C:\Users\JON.DONKEYNOB\Desktop\GOOGLE_EARTH" & [txt_type] & ".KML"
For Output As #1
Write #1, GENERATE_GOOGLE_EARTH_LOCATIONS([txt_type])
Close #1


The variable txt_type is just a way that my function knows if I want to
export live customers or potential customers from our sales

Any help appreciated.

Jon
 
J

John Spencer

Use the Replace function?

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
Thats fantastic John,
Thanks for your help.

I now have to replace some & characters within my script with + symbols
(because I've found that Google doesn't like the & symbol.

Any ideas how to do a find and replace within my function ?


Jon

John Spencer said:
Try using Print instead of Write

John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
Hi,
I want to export a list of customer accounts into a Google KML file,
so that clicking on the file will show all their locations on google
earth.

I have managed to generate the correct format of the KML file using a
function I have created in Access97, and the output of the function
is perfectly accurate.

I have then saved the output to a text file ( but added a KML
extension) , but during the output stage, double quotations are added
at the beginning and at the end of the functions content, and in
addition any double quotations that existed within the string are
repeated.

For example
The first line should read
<?xml version="1.0" encoding="UTF-8"?>

But it actually exports as
"<?xml version=""1.0"" encoding=""UTF-8""?>

Here's how I create my KML file using my function

Open "C:\Users\JON.DONKEYNOB\Desktop\GOOGLE_EARTH" & [txt_type] &
".KML" For Output As #1
Write #1, GENERATE_GOOGLE_EARTH_LOCATIONS([txt_type])
Close #1


The variable txt_type is just a way that my function knows if I want
to export live customers or potential customers from our sales

Any help appreciated.

Jon
 

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