Beginner Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOtherBeginner Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 2nd, 2001, 02:40 PM
alshawver alshawver is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: North Dakota
Posts: 53 alshawver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
populate Access Db from ASP arrays

I have 4 asp arrays. I want to populate an Access table with them.

Each array of course has mulitple records.

Array1
Array2
Array3
Array4

Array1 (1) should fill in row 1 column 1 of the table
Array2 (1) should fill in row 1 column 2 of the table

Array1 (2) should fill in row 2 column 1 of the table
Array2 (2) should fill in row 2 column 2 of the table
etc.....

Any help would be appreciated.

Reply With Quote
  #2  
Old November 2nd, 2001, 10:00 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Delete your duplicate post.

Reply With Quote
  #3  
Old November 4th, 2001, 12:09 AM
Shiju Rajan's Avatar
Shiju Rajan Shiju Rajan is offline
.Net Developer
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: London
Posts: 987 Shiju Rajan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 26 m 22 sec
Reputation Power: 9
Send a message via MSN to Shiju Rajan Send a message via Yahoo to Shiju Rajan
alshawver ,
You need to loop through the arrays one by one and update the access table.

eg:


<%
recordset.addnew

for a=0 to ubound(Array1)-1
'find out the upper number of the array

recordset(0)=Array1[a]
'first column
recordset(1)=Array1[a]
'second column
next


for b=0 to ubound(Array2)-1
'find out the upper number of the array

recordset(0)=Array2[b]
'first column
recordset(1)=Array2[b]
'second column
next

'----- like wise loop through the other arrays as well

recordset.update
'update your table here
%>
__________________
SR -
webshiju.com
www.lizratechnologies.com

"The fear of the LORD is the beginning of knowledge..."

Reply With Quote
  #4  
Old November 5th, 2001, 11:41 AM
alshawver alshawver is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2001
Location: North Dakota
Posts: 53 alshawver User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 8
ok I got the recordset to populate. Thanks

I have another problem.

I am passing the arrays from a javascript form to this asp page.
Currently I am passing the length of the arrays with them from the form.

How can I get the length of the arrays without passing it??

I've tried:

dim array1()

array1 = Request.Form("array1fromform")
highArray1 = UBound("array1")
lowArray1 = LBound("array1")
length = highArray1 - lowArray1 + 1

This gives me a 'type mismatch' error.

----------------------------------------------------------------
Then I tried:

dim array1()

array1() = Request.Form("array1fromform")
highArray1 = UBound("array1")
lowArray1 = LBound("array1")
length = highArray1 - lowArray1 + 1

This gives me a 'subscript out of range' error.

----------------------------------------------------------------
Then I tried:

dim strArray1
dim Array1

strArray1 = Request.Form("array1fromform")
Array1 = split(strArray1, ",") 'figuring the form is passing a string
highArray1 = UBound("Array1")
lowArray1 = LBound("Array1")
length = highArray1 - lowArray1 + 1

This also give me a 'type mistmatch' error.

Any suggestions??????

Reply With Quote
  #5  
Old November 7th, 2001, 06:53 AM
Shiju Rajan's Avatar
Shiju Rajan Shiju Rajan is offline
.Net Developer
Dev Shed Novice (500 - 999 posts)
 
Join Date: Feb 2000
Location: London
Posts: 987 Shiju Rajan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 26 m 22 sec
Reputation Power: 9
Send a message via MSN to Shiju Rajan Send a message via Yahoo to Shiju Rajan
The length of the array you should get using UBound(Array)+1.

eg: UBound(Array1)+1


Try the following and tell me the result:

<%
dim strArray1
dim Array1

'strArray1 = Request.Form("array1fromform")

strArray1="hello,from,shiju"
'test string

Array1 = split(strArray1, ",") 'figuring the form is passing a string

'highArray1 = UBound(Array1)
'lowArray1 = LBound(Array1)
'length = highArray1 - lowArray1 + 1

length=UBound(Array1)+1
'total of the above array .

response.write(length)
//print the length

%>

Reply With Quote
Reply

Viewing: Dev Shed ForumsOtherBeginner Programming > populate Access Db from ASP arrays


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway