Trying to write a script that converts a (used cars) flat-file-database to an Access-database, I keep running into the following problem:
The original, flat-file-db, looks like this:
id|mark|type|field4|field5|field6|PRICE|field8 etc.
Using the FileSystemObject, the script reads the lines and, using MyArray = Split(strLine,"|", puts the values in an array. After that, the script assigns the values to their respective access-db-fields: rst("Mark" = MyArray(1) etc. All fields go well, except for the PRICE field. This is the only field that is declared as being numeric in Access, but I didn't think that had to be a problem. As it turns out, it is. rst("Price" = MyArray(7) doesn't work, whereas manually assigning a 'string' type value to it does: rst("Price" = "17950" works fine. But that's useless, as you'll all understand.
My question: how on earth can I solve this problem? It's really important, because otherwise I will have to manually insert hundreds of cars in the Access-db ;-)
The original, flat-file-db, looks like this:
id|mark|type|field4|field5|field6|PRICE|field8 etc.
Using the FileSystemObject, the script reads the lines and, using MyArray = Split(strLine,"|", puts the values in an array. After that, the script assigns the values to their respective access-db-fields: rst("Mark" = MyArray(1) etc. All fields go well, except for the PRICE field. This is the only field that is declared as being numeric in Access, but I didn't think that had to be a problem. As it turns out, it is. rst("Price" = MyArray(7) doesn't work, whereas manually assigning a 'string' type value to it does: rst("Price" = "17950" works fine. But that's useless, as you'll all understand.
My question: how on earth can I solve this problem? It's really important, because otherwise I will have to manually insert hundreds of cars in the Access-db ;-)