Hi!
I have a major problem with Access...
There is a table myTable_1 with some fields (int, text, long). What I do is run a query on this table and insert the result in a second table myTable_2. myTable_2 has only text-fields, so the int and long values will get converted.
No problem so far...
After that I try to export myTable_2 with a module:
This works as well... but there is one strange thing going on. I told the fields in myTable_2 to allow values of zero-length and the default value should be "" (empty string). Some fields of myTable_1 have NULL-Values and after "copying" the fields in myTable_2 and exporting the table I will have "NULL" as values in my textfile but I want "" (empty string).
What am I doing wrong?
Cheers
frag
patrick.metz@epost.de
I have a major problem with Access...
There is a table myTable_1 with some fields (int, text, long). What I do is run a query on this table and insert the result in a second table myTable_2. myTable_2 has only text-fields, so the int and long values will get converted.
No problem so far...
After that I try to export myTable_2 with a module:
Code:
Private Function putDifs()
Dim DB As Database
Set DB = CurrentDb
Dim MD As Recordset
Set MD = DB.OpenRecordset("myTable_2")
Open "C:\myFile.txt" For Output As #1
MD.MoveLast
MD.MoveFirst
Do Until MD.EOF
Print #1, ; MD![Field1]; "|"; MD![Field2]; "|"; MD![Field3]; "|"; MD![Field4]; "|"
MD.MoveNext
Loop
MD.Close
Close #1
End Function
This works as well... but there is one strange thing going on. I told the fields in myTable_2 to allow values of zero-length and the default value should be "" (empty string). Some fields of myTable_1 have NULL-Values and after "copying" the fields in myTable_2 and exporting the table I will have "NULL" as values in my textfile but I want "" (empty string).
What am I doing wrong?
Cheers
frag
patrick.metz@epost.de