Notices
Computer & Technology Related Post here for help and discussion of computing and related technology. Internet, TVs, phones, consoles, computers, tablets and any other gadgets.

ASP coding

Old 03 April 2004, 12:22 AM
  #1  
MaxPower2010
Scooby Newbie
Thread Starter
 
MaxPower2010's Avatar
 
Join Date: Jun 2003
Posts: 5
Likes: 0
Received 0 Likes on 0 Posts
Lightbulb ASP coding

Can anyone help me with some ASP code.
I have a database which i have been able to write asp code to update my tables.
Adding data to the parent tables is working fine.
Cant seem to understand how i fill out a sub table where the primary key of the parent table is the foreign key in the child table.
For instance my userdetails table has a sub table of addresses as users can have many addresses.
the part of the code that seems to be failing that im using is:
set objRS = server.CreateObject ("ADODB.Recordset")
objRS.Open "StudentAddresses", strConnect, adOpenStatic, adLockOptimistic, adCmdTable

do while not objRS.EOF
if objRS("StudentID")=Sid Then

objRS("Address type")="home"
objRS("Street Address1")=Add1
objRS("Street Address2")=Add2
objRS("Town")=Town
objRS("City")=City
objRS("Country")=Coun
objRS("Post code")=Pcode
objRS("Property Phone Number")=pPhone
end if
objRS.MoveNext
loop




'Save record
objRS.Update

objRS.close
set objRS=nothing


Its really driving me crazy. well if anyone has any ideas..please please please let me know
Thanx
.<.MP.>.
Old 03 April 2004, 05:40 PM
  #2  
sti555
Scooby Regular
 
sti555's Avatar
 
Join Date: Dec 2003
Location: cheshire
Posts: 1,180
Likes: 0
Received 0 Likes on 0 Posts
Default

MP,

good resources here:


www.aspin.com

What is the db & asp page gonna do?, may have something in my 'libary' you can adapt

PM me with more info

Related Topics
Thread
Thread Starter
Forum
Replies
Last Post
Darrell@Scoobyworx
Trader Announcements
26
30 January 2024 01:27 PM
Abx
Subaru
22
09 January 2016 05:42 PM
Mattybr5@MB Developments
Full Cars Breaking For Spares
28
28 December 2015 11:07 PM
Mattybr5@MB Developments
Full Cars Breaking For Spares
12
18 November 2015 07:03 AM
Sam Witwicky
Engine Management and ECU Remapping
17
13 November 2015 10:49 AM


Thread Tools
Search this Thread
Quick Reply: ASP coding



All times are GMT +1. The time now is 03:12 PM.