Webmaster Forum

Go Back   Webmaster Forum > Scripting/Programming & Debugging > ASP & VBScript Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

ASP & VBScript Forum Need help from a webmaster with ASP or VBScript, you may ask in this forum?

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-04-2007, 09:09 PM
mbordeaux mbordeaux is offline
Junior Member
 
Join Date: Dec 2007
Posts: 1
mbordeaux is an unknown quantity at this point
Submit to Clesto Submit to Digg Submit to Reddit Submit to Furl Submit to Del.icio.us Submit to Jeqq Submit to Spurl
Default Import of Recordset from CSV - Character problem

I have a CSV file that I'm importing into Word in a report format. I have everything working and it imports all the columns, but I'm coming up with some strange characters in the following cases:

CSV file = doen't
Import = doesn’t

CSV file = ...
Import = …

Can someone help me out with this, as I have hit a wall and don't know where to go from here.

Below is the area that I think is causing me the problem.

__________________

Public Function ParseParams(RecordString As String)
Dim sTmp() As String
Dim tmpStr As String
Dim I As Integer
tmpStr = RecordString
tmpStr = Replace(tmpStr, """""", Chr(4))

Do While ((InStr(1, tmpStr, """,") > 0) Or (InStr(1, tmpStr, ",""") > 0))
tmpStr = Replace(tmpStr, """,", Chr(1) + ",")
tmpStr = Replace(tmpStr, ",""", "," + Chr(1))
Loop

sTmp = Split(tmpStr, Chr(1))
tmpStr = ""
For I = 0 To UBound(sTmp)

If (I Mod 2) = 0 Then
tmpStr = tmpStr & Replace(sTmp(I), ",", Chr(2))
Else
tmpStr = tmpStr & sTmp(I)
End If
Next I
tmpStr = Replace(tmpStr, Chr(4), """")
tmpStr = Replace(tmpStr, "?", """")

sTmp = Split(tmpStr, Chr(2))
ParseParams = sTmp
End Function

__________________

Thanks,
Michael
Reply With Quote

This ad is part of our Revenue Sharing program
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:05 AM.


Creative Commons License
Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.0.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30