A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

schema.ini (again) sure Access is not reading it.



 
 
Thread Tools Display Modes
  #1  
Old March 4th, 2009, 01:27 PM posted to microsoft.public.access.externaldata,microsoft.public.access.modulescoding,microsoft.public.access.tablesdbdesign
Rod
external usenet poster
 
Posts: 25
Default 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  
Old March 6th, 2009, 08:16 AM posted to microsoft.public.access.externaldata,microsoft.public.access.tablesdbdesign,microsoft.public.access.modulescoding
Ritwik Shukla
external usenet poster
 
Posts: 1
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:58 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.