Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trouble with apostrophe

Status
Not open for further replies.

ttuser4

MIS
Jun 19, 2008
147
CA
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





 
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.
 
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.
 
>those are quotes, not apostrophes

Nah! Technically, they’re primes ... ;-)
[tt]
" Double prime
' Prime
“ Left double quote
” Right double quote
‘ Left single quote
’ Right single quote/apostrophe
[/tt]
 
Interesting -
How do you produce left and right double quotes and the left single quote?
What are they used for?
 
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)
 
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)?
 
>other than purely cosmetic

I'm simply being typographically correct
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top