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

Thread Tools
 
Search this Thread
 
Old Apr 3, 2004 | 12:22 AM
  #1  
MaxPower2010's Avatar
MaxPower2010
Thread Starter
Scooby Newbie
 
Joined: Jun 2003
Posts: 5
Likes: 0
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.>.
Reply
Old Apr 3, 2004 | 05:40 PM
  #2  
sti555's Avatar
sti555
Scooby Regular
 
Joined: Dec 2003
Posts: 1,180
Likes: 0
From: cheshire
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

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




All times are GMT +1. The time now is 10:27 AM.