Wayne Barron
asked on
Textfield - Multi Field insert
Hello All;
Got something that i have been wondering how to do for several years now.
(When it comes to me, I think about how it could be done)
Textfield.
have it to where each line does a break. (String)
And then you look at each break in the textfield, to determin how many strings you have.
You then have an INSERT Statement that will insert each line (String) into indivisual fields.
(Multi Field insert statement)
So.
To break it down.
Take a continues string from a Textfield
Break it down to indivisual strings (Per row)
And insert indivisual records into a Table.
Hope that it is clear.
Just something that I have been wondering about for a while.
What made me thing about it was that I have an Old Perl script
That uses a Textfield and for each row, it inserts into the MySQL database.
So.
If it can be done in Perl/MySQL
It should be able to be done in ASP/Access (or) (SQL Server)
(I am using Access)
have a good one all.
Carrzkiss
Got something that i have been wondering how to do for several years now.
(When it comes to me, I think about how it could be done)
Textfield.
have it to where each line does a break. (String)
And then you look at each break in the textfield, to determin how many strings you have.
You then have an INSERT Statement that will insert each line (String) into indivisual fields.
(Multi Field insert statement)
So.
To break it down.
Take a continues string from a Textfield
Break it down to indivisual strings (Per row)
And insert indivisual records into a Table.
Hope that it is clear.
Just something that I have been wondering about for a while.
What made me thing about it was that I have an Old Perl script
That uses a Textfield and for each row, it inserts into the MySQL database.
So.
If it can be done in Perl/MySQL
It should be able to be done in ASP/Access (or) (SQL Server)
(I am using Access)
have a good one all.
Carrzkiss
ASKER
OK.
I have read something about this before.
Would you have some resources on this, or possibly could you make up a souce example?
Thanks AI
You are actually the first person that has said that it is possible.
The last time that I posted this same topic years ago, I was told that
You could not take a continues string and split it.
I have read something about this before.
Would you have some resources on this, or possibly could you make up a souce example?
Thanks AI
You are actually the first person that has said that it is possible.
The last time that I posted this same topic years ago, I was told that
You could not take a continues string and split it.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
strange.
I am getting this error
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/Test/EE/Q_24163759/Insert .asp, line 16, column 13
Dim strArray = Split(Request.Form("MyText Field"), vbCrLf)
------------^
I am getting this error
Microsoft VBScript compilation (0x800A0401)
Expected end of statement
/Test/EE/Q_24163759/Insert
Dim strArray = Split(Request.Form("MyText
------------^
Oh, I'm thinking in asp.net, just split it into two lines.
Dim strArray
strArray = Split(Request.Form("MyText Field"), vbCrLf)
Dim strArray
strArray = Split(Request.Form("MyText
ASKER
:)
I have thought about venturing into ASP.NET
But I am just know getting to where I can do a lot of things in ASP Classic.
So, I will wait until there is something that I want to do, that can only be done in .NET.
I have thought about venturing into ASP.NET
But I am just know getting to where I can do a lot of things in ASP Classic.
So, I will wait until there is something that I want to do, that can only be done in .NET.
ASKER
I'll be darn.
Worked like a charm.
You did what others said could not be done.
That was so simple. You have just done something that I have wanted to do for years in ASP.
Proven that ASP is just as powerful as PERL
Thank you so very, very much.
Wayne
Worked like a charm.
You did what others said could not be done.
That was so simple. You have just done something that I have wanted to do for years in ASP.
Proven that ASP is just as powerful as PERL
Thank you so very, very much.
Wayne
ASKER
You Rock BIG TIME.
strArray = Split(txtBoxText, vbCrLf)
That will put the values into an array, so
strArray(0) = first line
strArray(1) = second line
etc.
Then just loop throw the array and insert each string.