473,500 Members | 1,753 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Putting quotes around strings

2 New Member
Hi all

I am looking to drop data into a table for export to a csv file for example see below.

DoCmd.RunSQL "SELECT Temp11.RowNum As RowNum, " &_
"Replace(Temp11.studEnrolment1,',','') AS studEnrolment1 " &_
" INTO Tempory FROM Temp11"

I am wanting to put "" marks around the string data to meet a requirment in the csv file i have played around with chr(34) and a few other ideas with no luck. can anybody either help me to put quotes around the field data in this step or perhaps there is a way in the final export to csv to put all the fields in quotes

ie set the delimiter to {","} rather then simply ,

DoCmd.TransferText acExportDelim, , "Tempory", strDBPath, True
Aug 14 '07 #1
2 2126
ramaswamynanda
32 New Member
Hello,
What is the error that you are getting? If you are just trying to put quotes around the string fields then this might work. I have replaced your table name ith employeeinfo.

SELECT '"'+[employeeinfo].[firstname]+'"' AS studEnrolment1 INTO Tempory
FROM employeeinfo;


Nanda

Hi all

I am looking to drop data into a table for export to a csv file for example see below.

DoCmd.RunSQL "SELECT Temp11.RowNum As RowNum, " &_
"Replace(Temp11.studEnrolment1,',','') AS studEnrolment1 " &_
" INTO Tempory FROM Temp11"

I am wanting to put "" marks around the string data to meet a requirment in the csv file i have played around with chr(34) and a few other ideas with no luck. can anybody either help me to put quotes around the field data in this step or perhaps there is a way in the final export to csv to put all the fields in quotes

ie set the delimiter to {","} rather then simply ,

DoCmd.TransferText acExportDelim, , "Tempory", strDBPath, True
Aug 14 '07 #2
drew007
2 New Member
Thankyou for your reply Nanda.

Unfortunaly this and many variations of the same idea are creating a table with the field name as field data repeated for every entry. i.e



[employeeinfo].[firstname] jones 001
[employeeinfo].[firstname] smith 002
[employeeinfo].[firstname] black 003
[employeeinfo].[firstname] smith 004

I think this is because the docmd is interpreting the sql string that is comming out and this says use what is between the quotes as a string. I realy think if anybody can tell me the easiest way to handle it would be if the deliminator can be set in an export function at all.

once again thankyou.
Aug 15 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
8247
by: sinister | last post by:
The examples in the online manual all seem to use double quotes, e.g. at http://us3.php.net/preg_replace Why? (The behavior is different with single quotes, and presumably simpler to...
1
3515
by: Mike Vieths | last post by:
I'm running into a problem when I try to run commands with os.execv. It seems to be putting quotation marks around each element of the list passed as its second argument. This is fine for the...
4
3663
by: beliavsky | last post by:
The code for text in open("file.txt","r"): print text.replace("foo","bar") replaces 'foo' with 'bar' in a file, but how do I avoid changing text inside single or double quotes? For making...
4
8321
by: Gerald Aichholzer | last post by:
Hello, I need to specify the following attribute in an xhtml-file containing TAL templates: <div tal:attributes="onMouseOver concat('func(',xyz,')')"> which results in <div...
0
80495
NeoPa
by: NeoPa | last post by:
Background Whenever code is used there must be a way to differentiate the actual code (which should be interpreted directly) with literal strings which should be interpreted as data. Numbers don't...
5
2417
by: Hank Moss | last post by:
I've been able to get the <qelement and the CSS quotes property to work well together in English, but not in Russian or mixed Russian and English. I probably don't have a firm enough grasp of the...
4
12709
by: Michael Yanowitz | last post by:
Hello: If I have a long string (such as a Python file). I search for a sub-string in that string and find it. Is there a way to determine if that found sub-string is inside single-quotes or...
6
5718
by: Schroeder, AJ | last post by:
Hello group, I am attempting to remove double quotes from the beginning and ending of a string. Admittedly, I am not the best with regular expressions, but I do have two that work with...
14
1891
by: adam.timberlake | last post by:
This is a really basic question for all you people out there who know PHP. This is not a problem but just something I'm confused about. I was reading the article below and wondered why are normal...
0
7149
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7021
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7242
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6914
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4928
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3112
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1434
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
686
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
318
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.