|
-
Nov 6th, 2000, 09:30 AM
#1
Thread Starter
Fanatic Member
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

-
Nov 6th, 2000, 09:46 AM
#2
Hyperactive Member
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.
-
Nov 6th, 2000, 09:47 AM
#3
Fanatic Member
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...
-
Nov 6th, 2000, 10:10 AM
#4
Thread Starter
Fanatic Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|