Results 1 to 4 of 4

Thread: Quotes

  1. #1

    Thread Starter
    Fanatic Member Gary.Lowe's Avatar
    Join Date
    May 2000
    Location
    In my sphere of influence
    Posts
    621

    Unhappy

    Hi All

    I have a file which is in the following format

    23:0:12:"Hello":"":"":"04":

    I can split thwm up into seperate fields and enter the values in the database.

    The trouble is the ones in quotes get input into the database with quotes.

    i.e. Hello would be "Hello" in the database and a blank line would be "". Also 04 would be input into the database as "04".

    How can I get rid of these quotes before adding the value to the database?
    Gary Lowe
    VB6 (Enterprise) SP5
    ADO 2.6
    SQL Server 7 SP3

    OK I know my spelling and grammer is crap so don't quote me on it!

    To err is human to take the P! is only natural !!

    Click on the top section of image for Marcus Miller website and bottom section of image for 'Run For Cover' sound clip


  2. #2
    Hyperactive Member vbuser1976's Avatar
    Join Date
    Sep 2000
    Location
    Yonkers, NY
    Posts
    404

    Lightbulb Try this...

    Check the datatypes and try to change them, if you can. If you change the datatype of the "04" to integer, the quotes will not be saved and the value will be saved as 4.

    Hope this helps.

  3. #3
    Fanatic Member
    Join Date
    Oct 2000
    Location
    London
    Posts
    1,008

    Quotes

    Your going to catch it in a minute...
    My mum, any time in the last 34 years

    Seriously, once you have parsed the data, why not use the Replace function.

    e.g. NewStr = Replace(OldStr, """", "")

    This will strip off double quotes. Alternatively use Left$ and Right$ to trim off the first and last chars.

    Cheers,

    Paul.
    Not nearly so tired now...

    Haven't been around much so be gentle...

  4. #4

    Thread Starter
    Fanatic Member Gary.Lowe's Avatar
    Join Date
    May 2000
    Location
    In my sphere of influence
    Posts
    621
    Thanks everyone

    I managed to do it by seeing if """" was in the string.
    I then used mid to return the vaue(if any) excluding the quotes.
    Gary Lowe
    VB6 (Enterprise) SP5
    ADO 2.6
    SQL Server 7 SP3

    OK I know my spelling and grammer is crap so don't quote me on it!

    To err is human to take the P! is only natural !!

    Click on the top section of image for Marcus Miller website and bottom section of image for 'Run For Cover' sound clip


Posting Permissions

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



Click Here to Expand Forum to Full Width