|
窗体“天津北特”导出的.txt文件选择保存路径编辑
Private Sub Command2_Click()
Dim Ff%
Dim strFnm$
Dim n&, col%
Dim strtmp As String
Dim str
str = GetFolder(Me.hWnd, "浏览文件夹") '取得选取路径
strFnm = str & "\导出.txt"
Ff = FreeFile
With Adodc1.Recordset
n = .RecordCount
col = .Fields.Count
If n > 0 Then
Open strFnm For Output As #Ff
.MoveFirst
Do While Not .EOF
strtmp = ""
For j = 0 To col - 1
strtmp = strtmp & IIf(strtmp = "", "", vbTab) & .Fields(j)
Next j
Print #Ff, strtmp
.MoveNext
Loop
Close #Ff
MsgBox "导出完成!文件位置:" & vbCrLf & str & "\导出.txt"
End If
End With
End Sub
修改一下啊
qihaizhong2013 发表于 2013-6-21 10:42
在导出的内容里不包含表头呀!如果我想导出内容包含表头可以吗?
已加上表头
如问题已解决,请设置最佳答案
如果还有新的问题,重新发帖提问。
303451-VB-入库信息管理系统.rar
(316.39 KB, 下载次数: 220)
|
|