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.>. |
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 :D |
All times are GMT +1. The time now is 06:35 AM. |
© 2024 MH Sub I, LLC dba Internet Brands