If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Write Text File without Quotes using Text Driver

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-20-04, 01:20
jigar_1676 jigar_1676 is offline
Registered User
 
Join Date: Feb 2004
Location: India
Posts: 22
Question Write Text File without Quotes using Text Driver

Hi All,
I am facing one problem. I am poplulating recordset from text file for writing using Microsoft Text Driver. And I add some records and update the recordsert. It is writing in the text file but it the values are written with Quotes. I do not want quotes for alphanumeric fields. At the same time I can not use Fixed Length for field defination as it should be of varing size as per the user enters the data.

Following is the code:

Dim rs As New ADODB.Recordset
Dim con As New ADODB.Connection
con.CursorLocation = adUseServer
con.Open "Driver={Microsoft Text Driver (*.txt; *.csv)};" & _
"DBQ=" & App.Path & ";"
rs.ActiveConnection = con
rs.LockType = adLockBatchOptimistic
rs.CursorLocation = adUseClient
rs.CursorType = adOpenKeyset
rs.Open "SELECT * FROM [import.txt] WHERE 1=2"
rs.AddNew
rs.Fields(0) = "Test1"
rs.AddNew
rs.Fields(0) = "Test2"
rs.UpdateBatch
Set rs = Nothing
End Sub

Output to the Text File is
Field1
"Test1"
"Test2"

I need Output without quotes like following
Field1
Test1
Test2

Can anybody help me??
Thanks in advance
__________________
Regards,
Jigar Bhavsar
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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