473,405 Members | 2,287 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

input box

Hi, I have an input box that sends data over to the next page. This
input box was in a loop, there creating data looking like this: 2, 0,
0, 3, 0, 4, 0, 22, 0, 0, 0

How do i break the data up in such a way that i can populate it into my
db while running through a recordset?

Any help would be highly appreciated. Thanx

Nov 1 '06 #1
3 1539
amatuer wrote on 01 nov 2006 in microsoft.public.inetserver.asp.general:
Hi, I have an input box that sends data over to the next page. This
input box was in a loop, there creating data looking like this: 2, 0,
0, 3, 0, 4, 0, 22, 0, 0, 0

How do i break the data up in such a way that i can populate it into my
db while running through a recordset?

Any help would be highly appreciated. Thanx
I think we need relevant code, what database and database engine you use.

Why a recordset?
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Nov 1 '06 #2
Evertjan. a écrit :
amatuer wrote on 01 nov 2006 in microsoft.public.inetserver.asp.general:
>Hi, I have an input box that sends data over to the next page. This
input box was in a loop, there creating data looking like this: 2, 0,
0, 3, 0, 4, 0, 22, 0, 0, 0

How do i break the data up in such a way that i can populate it into my
db while running through a recordset?

Any help would be highly appreciated. Thanx

I think we need relevant code, what database and database engine you use.

Why a recordset?

First you must split your string into an array using the Split function:

MyArray = Split(MyString,", ")

Then you can loop through the values and do what you need with them:

For Each MyValue In MyArray
sql = "INSERT INTO MyTable(MyField,OtherField1,OtherField2,...)
VALUES(MyValue,OtherValue1,OtherValue2,...);"
RS.Open sql
Next

(The example above assuming you need to add records to a database table)
Nov 1 '06 #3
I split the string. bt nw im getn this error:

Provider error '80040e1b'

Identity cannot be determined for newly inserted rows.

/reenval/RInset2.asp, line 40

<% If Fout <1 Then %>
<% sql="Select * FROM R_Reenval"
set rstMainU = CreateObject("ADODB.Recordset")
rstMainU.Open sql, _
"Provider=SQLOLEDB.1;Persist Security Info=False;User
ID=sa;password=admin@sql;Initial Catalog=GIS;Data
Source=172.16.4.180",1,4
rstMainU.addnew
i = 0
j = 0
k = 0
While not rstMain.eof
Silo = split(Request.Form("Silo"),",")
line 40 rstMainU("Naam") = Silo(j)
rstMainU("Datum") = NewDatum
rstMainU("Jaar") = request.form("Jaar")
rstMainU("Maand") = request.form("Maand")
rstMainU("Dag") = request.form("Dag")
Reen = split(Request.Form("Reenval"),",")
rstMainU("Reenval_Silo") = Reen(i)
rstMainU("Sek_ID") = session("ID")
If telreg <0 Then
streek = split(Request.Form("Region"),",")
rstMainU("Region") = streek(k)
Else
rstMainU("Region") = ""
End If
rstMainU.updatebatch
i = i + 1
j = j + 1
k = k + 1
rstMain.Movenext
wend%>
Arnost Sobota wrote:
Evertjan. a écrit :
amatuer wrote on 01 nov 2006 in microsoft.public.inetserver.asp.general:
Hi, I have an input box that sends data over to the next page. This
input box was in a loop, there creating data looking like this: 2, 0,
0, 3, 0, 4, 0, 22, 0, 0, 0

How do i break the data up in such a way that i can populate it into my
db while running through a recordset?

Any help would be highly appreciated. Thanx
I think we need relevant code, what database and database engine you use.

Why a recordset?

First you must split your string into an array using the Split function:

MyArray = Split(MyString,", ")

Then you can loop through the values and do what you need with them:

For Each MyValue In MyArray
sql = "INSERT INTO MyTable(MyField,OtherField1,OtherField2,...)
VALUES(MyValue,OtherValue1,OtherValue2,...);"
RS.Open sql
Next

(The example above assuming you need to add records to a database table)
Nov 1 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: gotcha | last post by:
I have a little code to add multiple items to a shopping cart based page. This code works perfect, but it adds all of the info to the same input fields every time it loops. I need it to change...
3
by: david | last post by:
HI! Im trying to make "HTML form" into automatic. 1. If I get 18 numbers like: A B C D E F . . . . 2. How can I put those 18 numbers automatically into 6 numbers format like: A B C D E F
2
by: SophistiCat | last post by:
Hi, I am working on a computational program that has to read a number of parameters (~50) from an input file. The program contains a single class hierarchy with about a dozen member-classes or...
2
by: Cranky | last post by:
Ok, here is my scenario: I need to input numbers using my handheld IPAQ. I figured out how to create an online numeric keypad for inputting numbers into an input field, what I need to know is how...
3
by: acecraig100 | last post by:
I am fairly new to Javascript. I have a form that users fill out to enter an animal to exhibit at a fair. Because we have no way of knowing, how many animals a user may enter, I created a table...
3
by: cbradio | last post by:
Hi, I am having trouble developing a form in a restricted environment. My sample code is found below my message (sorry I don't have a URL). Basically, without a doctype, the form displays properly...
18
by: Diogenes | last post by:
Hi All; I, like others, have been frustrated with designing forms that look and flow the same in both IE and Firefox. They simply did not scale the same. I have discovered, to my chagrin,...
13
by: cront | last post by:
I have a problem to work on: we will ask user to input anything and we will put that back onto the standard output with all set of brackets removed. We will not remove any single bracket e.g. ...
1
by: tcertain | last post by:
I am totally duh at javascript although I have 2 books trying to learn it. I am trying to add values to a form and have a calculate total at end. this is my form script. I have hours at end of...
1
by: printline | last post by:
Hello All I'm quite new to xml vs. PHP, so i hope someone can help with an issue i have been struggeling with. I have an html form, that when submitted, it should create an xml file, and save...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.