Avatar of BOB KUSPE
BOB KUSPE
 asked on

asp classic Split data and transfer it to another table ...

Dear all Experts in ASP Classic

I am working with asp classic and msaccess db

I need a bit help for this script to be executed according my needs.

<%
set conn=server.CreateObject("adodb.connection")
conn.open "Provider=Microsoft.jet.oledb.4.0;data source="& server.MapPath("db\bd1.mdb")
set rs_main=server.CreateObject("adodb.recordset")

rs_main.open "select fileid,title,texts from add0",conn,1,2

do while not rs_main.eof
    d=rs_main("texts")
	title=RS_MAIN("title")
	dim p
    p=1
    for x=1 to len(d)
    if mid(d,x,1)="," or mid(d,x,1)="." or mid(d,x,1)="!" then
    texts=mid(d,p,x-p)
    p=x+1
    conn.execute("insert into table2 values ("&rs_main("fileid")&",'"&title&"','"&texts&"')")
    end if
next
rs_main.movenext
loop
rs_main.close
set rs_main=nothing
%>

Open in new window



Where:

Table name = Add0
fields
fileid (autonumerical)
title (text=100)
texts (Memo)

Table name = table2
fileid (autonumerical with  duplicates)
title (text = 100 with duplicates)
texts (text = 100 with duplicates)


GOAL:

The script splits a long memo field into substrings splitted by "." or "," or "!", but not works adequately because sometimes a substring are larger than the width of the table2.texts

Do you know a way to change this script to split (1) the substrings in 10 words or (2) length (=100) avoiding to cut words or (3) each capital letter?

I would be grateful for any help..
ASPMicrosoft Access* split

Avatar of undefined
Last Comment
BOB KUSPE

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Fabrice Lambert

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
BOB KUSPE

ASKER
Many Thanks
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23