If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
schema.ini (again) sure Access is not reading it.
I have data file and schema.ini file both in same folder.
I am fairly sure that Access is ignoring the file as the results do not change if it is not there. The file is imported, but if there is a £ sign in the csv file the data item is replaced by null. Also if I change things like date format to mm/dd/yy the end result is unchanged. HELP The schema.ini and csv files are below. I import the file with the VBA code (Using Office XP) DoCmd.TransferText acImportDelim, , "Test Table", "C:\Data\Test.csv", True The schema file is [Test.csv] ColNameHeader=True Format = CSVDelimited Col1=MyLong Long Col2=MyString Text Col3=MyDate DateTime Col4=MyBoolean Bit Col5=MyMoney Currency DateTimeFormat = dd/mm/yyyy CurrencySymbol = £ CurrencyPosFormat = £1 CurrencyNegFormat = -£1 CurrencyDecimalSymbol =. The csv file is as below MyLong,MyString,MyDate,MyBoolean,MyMoney 1,a,23/02/2006,Yes,1 2,Bee,12/12/2009,No,£3.33 3,SEA,01/02/2009,,2.2 4,four,19/12/2000,Yes,0.01 34,34,,Yes,0.5 |
#2
|
|||
|
|||
schema.ini (again) sure Access is not reading it.
Try the open recordset method..... Function TestSchema() Dim db As DATABASE, rs As Recordset Set db = OpenDatabase("c:\my documents", False, _ False,"TEXT;Database=c:\my documents;table=Test.csv") Set rs = db.OpenRecordset("Test.csv") rs.MoveLast Debug.Print "Record count= " & rs.RecordCount rs.Close End Function "Rod" wrote: I have data file and schema.ini file both in same folder. I am fairly sure that Access is ignoring the file as the results do not change if it is not there. The file is imported, but if there is a £ sign in the csv file the data item is replaced by null. Also if I change things like date format to mm/dd/yy the end result is unchanged. HELP The schema.ini and csv files are below. I import the file with the VBA code (Using Office XP) DoCmd.TransferText acImportDelim, , "Test Table", "C:\Data\Test.csv", True The schema file is [Test.csv] ColNameHeader=True Format = CSVDelimited Col1=MyLong Long Col2=MyString Text Col3=MyDate DateTime Col4=MyBoolean Bit Col5=MyMoney Currency DateTimeFormat = dd/mm/yyyy CurrencySymbol = £ CurrencyPosFormat = £1 CurrencyNegFormat = -£1 CurrencyDecimalSymbol =. The csv file is as below MyLong,MyString,MyDate,MyBoolean,MyMoney 1,a,23/02/2006,Yes,1 2,Bee,12/12/2009,No,£3.33 3,SEA,01/02/2009,,2.2 4,four,19/12/2000,Yes,0.01 34,34,,Yes,0.5 |
Thread Tools | |
Display Modes | |
|
|