PeterBaileyUk
asked on
expert table to csv in access
I want to expert some tables I have a recordset that moves through the tables i want to save, I am having trouble
saving the table
it says error 3027
saving the table
it says error 3027
Dim Db As DAO.Database
Set Db = CurrentDb()
Dim rstClientDecodeTables As DAO.Recordset
Dim rstTable As DAO.Recordset
Dim rstTable2 As Object
Dim fldNew As Object
Dim strSQL As String
Dim strSQL2 As String
Dim strfield As String
Dim TableNameinFull As String
Dim qdef As QueryDef
Dim WordCountDecode As Long
Dim StrWordLength As String
Dim ModelName As String
Dim TblLength As Long
Dim ClientLength As Long
Dim reccount As Long
reccount = 0
strSQL = "SELECT MSysObjects.Name AS table_name" _
& " FROM MSysObjects" _
& " WHERE (((MSysObjects.Name) Like " & """*Extractionswithrules*""" & "))" _
& " ORDER BY MSysObjects.Name;"
Set rstClientDecodeTables = Db.OpenRecordset(strSQL)
Debug.Print strSQL
With rstClientDecodeTables
If rstClientDecodeTables.BOF And rstClientDecodeTables.EOF Then
Else
.MoveFirst
Do Until rstClientDecodeTables.EOF
fname = "n:/temp/pete/" + Format(Date, "yyyymm") + " " & .Fields("table_name").Value.csv
DoCmd.TransferText acExportDelim, , .Fields("table_name").Value, .Fields("table_name").Value, True
.MoveNext
Loop
End If
End With
rstClientDecodeTables.Close
Set rstClientDecodeTables = Nothing
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER