problem with selected column....pls help me....
hye.....
this is my coding
ption Compare Database
Option Explicit
'Public Sub Main()
'ExportDatabaseObjects()
'End Sub
'Public Sub ExportDatabaseObjects()
Public Sub Main()
On Error GoTo Err_ExportDatabaseObjects
Dim db As Database
'Dim db As DAO.Database
Dim td As TableDef
Dim i As Integer
Dim strFilename As String
Dim sExportLocation As String
Dim Expression As String
Dim returnValue() As String
Set db = CurrentDb()
sExportLocation = "N:\- Guest -\guestbcs\usrPrivate\irni\irni\access\"
For Each td In db.TableDefs 'Tables
If Left(td.Name, 4) <> "MSys" Then
strFilename = sExportLocation & td.Name & ".txt"
Debug.Print strFilename
DoCmd.TransferText acExportDelim, , td.Name, strFilename, True
'DoCmd.RunMacro "table_name"
End If
Next td
For i = 0 To db.QueryDefs.Count - 1
Application.SaveAsText acQuery, db.QueryDefs(i).Name, sExportLocation & db.QueryDefs(i).Name & ".txt"
Next i
Set db = Nothing
MsgBox "All table been exported as a text file to " & sExportLocation, vbInformation
Exit_ExportDatabaseObjects:
Exit Sub
Err_ExportDatabaseObjects:
MsgBox Err.Number & " - " & Err.Description
Resume Exit_ExportDatabaseObjects
End Sub
this coding will transfer all the data to text file...
but i want to transfer data to text file only column that i need....
can anobody help me....
hye.....
this is my coding
ption Compare Database
Option Explicit
'Public Sub Main()
'ExportDatabaseObjects()
'End Sub
'Public Sub ExportDatabaseObjects()
Public Sub Main()
On Error GoTo Err_ExportDatabaseObjects
Dim db As Database
'Dim db As DAO.Database
Dim td As TableDef
Dim i As Integer
Dim strFilename As String
Dim sExportLocation As String
Dim Expression As String
Dim returnValue() As String
Set db = CurrentDb()
sExportLocation = "N:\- Guest -\guestbcs\usrPrivate\irni\irni\access\"
For Each td In db.TableDefs 'Tables
If Left(td.Name, 4) <> "MSys" Then
strFilename = sExportLocation & td.Name & ".txt"
Debug.Print strFilename
DoCmd.TransferText acExportDelim, , td.Name, strFilename, True
'DoCmd.RunMacro "table_name"
End If
Next td
For i = 0 To db.QueryDefs.Count - 1
Application.SaveAsText acQuery, db.QueryDefs(i).Name, sExportLocation & db.QueryDefs(i).Name & ".txt"
Next i
Set db = Nothing
MsgBox "All table been exported as a text file to " & sExportLocation, vbInformation
Exit_ExportDatabaseObjects:
Exit Sub
Err_ExportDatabaseObjects:
MsgBox Err.Number & " - " & Err.Description
Resume Exit_ExportDatabaseObjects
End Sub
this coding will transfer all the data to text file...
but i want to transfer data to text file only column that i need....
can anobody help me....
Last edited: