csv data Help

Results 1 to 4 of 4

Thread: csv data Help

  1. #1
    ASP Viper Guest

    Default csv data Help

    I have a csv file which contains the following fields: customer, date, credit card, etc... <BR><BR>I have setup a DSN to access the csv file. I can access all of the fields without any problem. I am taking the data and adding it to an Access Database. Everything is Almost beautiful <BR><BR>Here&#039;s my problem: <BR>The credit card field - rs("Payment Credit Card") - in the csv file is 16 characters (all numbers). When I pull this data into my ASP page, it gives me a funky number, for example, my csv file shows 1234567890123456 as the credit card number, I get 1.23456789012346E+15. <BR><BR>I&#039;ve tried cDbl(rs("Payment Credit Card")), Cstr(rs("Payment Credit Card")), Parsing the field... all to no avail. <BR><BR>Does anyone have any suggestions... I&#039;ve spent hours trying to solve this...

  2. #2
    jamar Guest

    Default RE: csv data Help

    make sure it&#039;s a string datatype, if you&#039;re unsure explicity convert it. you&#039;re not going to do any calculations with a credit card number right? then why bother making it a numeric datatype?

  3. #3
    ASP Viper Guest

    Default RE: csv data Help

    That&#039;s what I want, but how do I explicity convert it?

  4. #4
    peterjl@austec.net.au Guest

    Default RE: csv data Help

    If a column in your csv file contains any cells that are all numeric, obdc seems to assume that it is a numeric data column, according to my tests.<BR><BR>So you need to prefix each credit card number with a non-numeric character to make ODBC see it as text. You could also do it by setting up a dsn and defining field format. Here is a sample from my schema.ini file in the data source folder:<BR><BR>[dat.csv]<BR>ColNameHeader=False<BR>Format=CSVDelimited<BR> MaxScanRows=0<BR>CharacterSet=OEM<BR>Col1=NAME Char Width 255<BR>Col2=CCNO Char Width 255<BR>Col3=POS Char Width 255<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts