Agent707
Newcomer
K, I'm not sure which forum this question goes in, so I am putting it here. Probably a database forum thing though...
Here's my problem.
I have a customer file [CSV] I am importing to SQL. I am using JET to read it into a dataset. I am using a schema.ini file to define columns, because I have one column with up to 1000 characters in it... so I have to define it as a Memo field so it won't truncate at 255 characters.
ANYWAY, I have one other column that has VERY large numbers in it. i.e. 4671070409010930000
This is, in effect an 8 byte integer.
My problem is, I can't seem to get it into my dataset without it *****ing the value. I can't define it as any kind of numberic type in my schema ini, as there is no decimal type. If I define it as long, I get an eroneous value. If I define it as double, I get overflows.
If I define it as text (Which I thought the logical answer), I get '4.67E+18'...????? which SQL can't convert to anything numeric. Even if it could, I loose a lot of the value due to precision.
Is my problem understood?
Any idea's? I need to get it into my dataset as TEXT without it changing it to '4.67E+18'. SQL can convert '4671070409010930000' to a decimal(19,0). It can't convert '4.67E+18' to Anything.
I don't think it's the end of the world if I can't get this column imported. They aren't asking for it to be displayed on the report (reason for import).
Here's my code that reads it into a ds.
schema file.
Here's my problem.
I have a customer file [CSV] I am importing to SQL. I am using JET to read it into a dataset. I am using a schema.ini file to define columns, because I have one column with up to 1000 characters in it... so I have to define it as a Memo field so it won't truncate at 255 characters.
ANYWAY, I have one other column that has VERY large numbers in it. i.e. 4671070409010930000
This is, in effect an 8 byte integer.
My problem is, I can't seem to get it into my dataset without it *****ing the value. I can't define it as any kind of numberic type in my schema ini, as there is no decimal type. If I define it as long, I get an eroneous value. If I define it as double, I get overflows.
If I define it as text (Which I thought the logical answer), I get '4.67E+18'...????? which SQL can't convert to anything numeric. Even if it could, I loose a lot of the value due to precision.
Is my problem understood?
Any idea's? I need to get it into my dataset as TEXT without it changing it to '4.67E+18'. SQL can convert '4671070409010930000' to a decimal(19,0). It can't convert '4.67E+18' to Anything.
I don't think it's the end of the world if I can't get this column imported. They aren't asking for it to be displayed on the report (reason for import).
Here's my code that reads it into a ds.
Code:
Private Function GetDataSetFromFile() As DataSet
Dim oleDBCon As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data" & _
" Source=" & mWorkingImportDirectory & _
";Extended Properties=""Text;HDR=Yes;FMT=Delimited""")
Dim oleDbDA As New OleDbDataAdapter()
Dim ds As New DataSet
Dim oleDbCmd As New OleDbCommand("SELECT * FROM " & mImportFile, oleDBCon)
oleDBCon.Open()
oleDbDA.SelectCommand = oleDbCmd
oleDbDA.Fill(ds, "CSV")
oleDBCon.Close()
Return ds
End Function
Code:
[ImportFile.csv]
Format=CSVDelimited
CharacterSet=ANSI
ColNameHeader=True
Col1=OrderDate DateTime
Col2=SupplierName Text Width 100
Col3=ItemDescription Memo
Col4=ItemQty Short
Col5=ItemPrice Currency
Col6=Subtotal Currency
Col7=Freight Currency
Col8=Tax Currency
Col9=Total Currency
Col10=AccountCode Long
Col11=ProjectNumber Text Width 19 <----- This is the problem child. changing this number has no affect.
Col12=CostCenter Text Width 10
Col13=BusinessPurpose Text Width 30
Col14=ReferenceNumber Text Width 20
Col15=InvoiceNumber Long
Col16=ShipDate DateTime
Col17=ReceivedDate DateTime