473,324 Members | 2,511 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,324 software developers and data experts.

parent key not found

idsanjeev
241 100+
parent key not found
--------------------------------------------------------------------------------

plz help me
i am using two table topmaster and reply topid is primary key in topmaster and topid and repid is foreign key in reply table
if one record in topmaster topid=1 then one record is submitted in reply table topid=1 repid=1 but antother now submitted second record topid=1 and repid=2 then error is parent key not found
id second record submit in topmster topid=2 then next one more record can submit in reply topid=1 or 2 and repid=2
so problems is before submition of record it serched topmaster table how many records in it is more then reply master table if yes then send error else submit record
so how can solve the problem
my code for submit in reply table is
code(asp):-
<%
R.Open "Select rep_id from reply order by rep_id", conn, adOpenStatic, adLockOptimistic, adCmdText
If R.Recordcount > 0 Then
R.Movelast
vrepid = R("rep_id")
vrepid = CInt(vrepid) + 1
Else
vrepid = 1
End if
R.Close
If Not IsEmpty(Request.Form("submit")) then
vtopid=request.form("vtopid")
vreply = Request.Form("vreply")
vtopid=trim(vtopid)
vrepid = trim(vrepid)
vreply = trim(vreply)
If len(errorMsg) = 0 Then
If len(vreply) = 0 Then
errorMsg = "Your must enter your Reply"
Elseif len(vreply) > 500 Then
errorMsg = "The voice you are entered is not longer than 500 characters. Please reduce the size."
End If
End If
If len(errorMsg) = 0 Then
conn.Close
conn.Mode = adModeReadWrite
conn.Open
R.Open "Select * from reply ", conn, adOpenStatic, adLockOptimistic, adCmdText
R.Addnew
R("top_id") =vtopid
R("rep_id") = vrepid
R("rep_by") = request.cookies("userid")
R("rep_dt") = Cdate(date())
R("reply") = vreply
R.UPdate
R.Close
Response.Redirect "voicereply.asp"
end if
end if
Oct 31 '07 #1
2 1487
jhardman
3,406 Expert 2GB
idsanjeev,

I'm afraid your English is not clear enough to understand what you are asking. I have attempted to clear up your post, but I was only able to understand the first few sentences, after that I couldn't understand you. Could you please try to re-write your problem in clear English? If not, you might need someone to translate your question or post in a forum where your native language is allowed.

Following is my attempt to clear up your post:
My code produces the error "parent key not found". Please help me.

My database has two tables named "topmaster" and "reply". "topid" is the name of the primary key in "topmaster" and "topid" and "repid" is the foreign key in "reply".

If one record in topmaster has topid=1 then one record is automatically submitted in reply table with topid=1 and repid=1.
After this I couldn't understand it.

Jared
Nov 2 '07 #2
idsanjeev
241 100+
hello i try to post a clear question on next time and now the of parent key not found is solved.
But i wants to when topid is change then rep_id start with one and increament with same topid and so on how i can't understand how to find it.Thanks taking response .i am very sorry to my english but i try to my best. Thanks again
Nov 3 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Suzanne Vogel | last post by:
Hi, Given: I have a class with protected or private data members, some of them without accessor methods. It's someone else's class, so I can't change it. (eg, I can't add accessor methods to the...
25
by: Steve Jorgensen | last post by:
Yup, Steve's full of tips, but hey, it makes him feel important, right? Ok, here goes. I've been trying to improve encapsulation by putting code in the same object as the stuff it affects, so I...
13
by: Stuart McGraw | last post by:
I haven't been able to figure this out and would appreciate some help... I have two tables, both with autonumber primary keys, and linked in a conventional master-child relationship. I've...
5
by: Zürcher See | last post by:
The Control class has the Parent property that is readonly. When the control is added to a controls collection of another control the Parent property refers to that control. "Who" set the Parent...
3
by: Peted | last post by:
I have a simple c# app that opens a child form in a mdi parent. I want the child form to open in the center of the mdi parent, so i can open the child form ok, it all works fine, but setting ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.