views:

29

answers:

1

i have a string like this

some_string=  "something, something2, something3, something4, etc.."

i would like to read this string into a table like this:

field1 = "something"
field2 = "something2"
etc

what is the best way to do this in vba/sql?

A: 

Use the variable in an INSERT query, listing the field names to match up with their location in the string:

INSERT INTO table_name ( field1, field2, ... )
VALUES ( $some_string );
VeeArr
i need it split by the comma delimitter
I__
What do you mean? In the example I gave, I assumed that $some_string is of the form "something, something2, something3, ..." as you gave in your example. It would expand to INSERT INTO table_name ( field1, field2, ... )VALUES ( something, something2, ... );
VeeArr
you are right thanks!!!!!!!!!!!!!!!
I__
David-W-Fenton