2011-07-08 80 views

回答

1

Convert XLS to CSV on command line

我想與上述相反的作品。

如果你想與數據本身在VB6(我假設你是因爲標籤的做)的工作,看到這個代碼this thread捏:

Dim cnn As New ADODB.Connection 
Dim rs As New ADODB.Recordset 

cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _ 
      "Data Source=" & "C:\Documents and Settings\...\My Documents\My Database\Text;" & _ 
      "Extended Properties=""Text;HDR=No;""" 

rs.Open "Select * from TextFile.csv", cnn, adOpenStatic, adLockReadOnly, adCmdText 

'... 
'... 
'... 

rs.Close 
cnn.Close 
Set cnn = Nothing 

CSV是TXT類型,其中場的一個特例用逗號分隔。您應該能夠提名任何字符,包括空格或製表符作爲分隔符。

+0

我得到一個錯誤,說用戶定義類型沒有定義。我該怎麼辦?我需要包括一些參考嗎? –

+0

錯誤究竟在哪裏? – spraff

+0

at line 1,dim cnn as new ADODB.Connection –

相關問題