Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...I have never been to any technical site that shows concern just to anybody with problems...I look forward to also share in the future..."

Geography

Where in the world do Tek-Tips members come from?
ttuser4 (MIS)
24 May 12 15:31
i am exporting data into a text file with this code:

sSQL = "Select [EMPID], [WDATE], [WTYPE], [WHRS], [PCODE], [WRATE] From WHOURS WHERE PAYPER=" & rst.Fields(0).Value & ";"
Set rs4 = New adodb.Recordset
rs4.Open sSQL, objAccessConnection, adOpenKeyset, adLockPessimistic
I = rs4.RecordCount
If I > 0 Then
While Not rs4.EOF
veta = rs4.Fields(0).Value & "," & rs4.Fields(1).Value & " 0:00:00," & rs4.Fields(2).Value & "," & rs4.Fields(3).Value & "," & rs4.Fields(4).Value & "," & rs4.Fields(5).Value
Put ff, , veta
rs4.MoveNext
Wend
End If
Put ff, , veta
Close ff

and I am getting this text:

479,5/14/12 0:00:00,O/T,1,90,8.75
479,5/14/12 0:00:00,R/T,8,90,8.75

but I need format with apostrophes so it would be like:

"479",5/14/12 0:00:00,"O/T",1,"90",8.75
"479",5/14/12 0:00:00,"R/T",8,"90",8.75

can you please help me to fix this?

thanks





ttuser4 (MIS)
24 May 12 16:04
ok, this Chr$(34) did it.
dilettante (MIS)
24 May 12 21:33
Er, those are quotes, not apostrophes.

There is a clean way to use quotes in a string literal:

CODE

S = """That's all, folks!"""

Using Chr$() is clumsy, slow, and awkward.
tedsmith (Programmer)
25 May 12 1:24
Never knew that before!
Andrzejek (Programmer)
25 May 12 21:35

If

Quote (dilettante)

those are quotes, not apostrophes

then what are double-quotes? smile

Have fun.

---- Andy

dilettante (MIS)
26 May 12 2:34
"Double-quotes" is a made up phrase. If you want to throw in U.K. "English" then things get even weirder, but not worry: VB and Windows don't come from the U.K.
strongm (MIS)
26 May 12 7:09
>those are quotes, not apostrophes

Nah! Technically, they’re primes ... winky smile

" Double prime
' Prime
“ Left double quote
” Right double quote
‘ Left single quote
’ Right single quote/apostrophe
dilettante (MIS)
26 May 12 7:19
Just don't start inverting your commas. [wink]
tedsmith (Programmer)
26 May 12 8:53
Interesting -
How do you produce left and right double quotes and the left single quote?
What are they used for?
PeterWallace (Programmer)
1 Jun 12 18:27
Set up a function
Public Function PutQuotes(ByRef txtToQuote As String) As String
Dim iASCII As Integer

iASCII = 34

PutQuotes = Chr(iASCII) & txtToQuote & Chr(iASCII)
End Function

and use as

WERE AName = " & PutQuotes(ASKFOR)
tedsmith (Programmer)
2 Jun 12 2:38
That just adds extra "quotes" (chr(34)) which according to stromgm is a prime

I have since found that the extra characters are in the vicinity of Chr(145)

What I meant was - what use in programming are these extra quote type masks as described by strongm (other than purely cosmetic)?
strongm (MIS)
2 Jun 12 5:12
>other than purely cosmetic

I'm simply being typographically correct

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close