with vb6 + access
how can i extract the portion of a string separated by a "-"
symbol
like i want to
INSERT the each piece of string in to a table
for eg: from string "axb-bh-c22-dtr-egt-f" into a table
axb
bh
c22
dtr
egt
f
Printable View
with vb6 + access
how can i extract the portion of a string separated by a "-"
symbol
like i want to
INSERT the each piece of string in to a table
for eg: from string "axb-bh-c22-dtr-egt-f" into a table
axb
bh
c22
dtr
egt
f
arrStrings = Split("axb-bh-c22-dtr-egt-f","-")
some more in detail please
You don't give me much to work with, but I'll give it a shot:
Basically just split your string by the delimiter, then iterate through the resulting array and insert each item into your database table.Code:Dim i As Long
Dim arrStrings() As String
Dim strSQL as String
arrStrings = Split("axb-bh-c22-dtr-egt-f","-")
For i = 0 To Len(arrStrings)
strSQL = "INSERT INTO table_name (column_name) VALUES ('" & arrStrings(i) & ",)"
myDatabaseConnection.Execute(strSQL)
Next i
thanks a lot
if delimiter is of multiple type like space or > then
is there any other function to evaluate it
thanks i used the replace function to make all unique