Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - add new record to Multi Joins DB
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

add new record to Multi Joins DB

 Post Reply Post Reply
Author
aero View Drop Down
Groupie
Groupie
Avatar

Joined: 21 May 2003
Location: Denmark
Status: Offline
Points: 80
Post Options Post Options   Thanks (0) Thanks(0)   Quote aero Quote  Post ReplyReply Direct Link To This Post Topic: add new record to Multi Joins DB
    Posted: 23 June 2003 at 11:53am

Hi.

I have a site where I can see som records from a db whit 3 table's http://www.javacoder.dk:56400/joins/show.asp

Now I will make a site where I can add some new records, but then I was thinking about something !!

It this posible !?
To make a form where there is 2 onChange="MM_jumpMenu

1. That show all the records in Table A + Add New
(Then if I select Add New there will come a textfield under or behind the jumpMenu where I then can write a new Location if I don't want to use some of the old's)

1. That show all the records in Table C + Add New
(Then if I select Add New there will come a textfield under or behind the jumpMenu where I then can write a new Employee if I don't want to use some of the old's)

and then I can submit the new one's.


MY DATABASE db.mdb
A
location_code = [Auto and Key]
location_name = [Text]

B
id = [Auto and Key]
location_code = [Number]
employee_number = [Number]

C
employee_number = [Auto and Key]
employee_name = [Text]


If U want to know how I am coding if U want to give me an ex. then is this my code to the site SHOW.ASP

<html>
</html>
<head>
</head>
<body>
<table width="260" border="0" cellpadding="0" cellspacing="0">
<%
Dim cn
Dim cnStr
Dim sql
Dim rs
Dim strSQL
Dim str

Dim strLName
Dim strENumber
Dim strEName


cnStr = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath ("db.mdb")
Set cn = Server.CreateObject("ADODB.Connection")
cn.Open cnStr

strSQL = "SELECT DISTINCT B.employee_number,C.employee_name,A.location_name  FROM B,C,A WHERE A.location_code = B.location_code AND B.employee_number=C.employee_number"
Set rs = cn.Execute(strSQL)

if rs.EOF then
Response.write "<font face=""Arial"" size=""2"">No Records</font>"
else
Do Until rs.EOF


   strENumber = rs("employee_number")
   strEName = rs("employee_name")
   strLName = rs("location_name")
  
response.write "<tr><td>" & strENumber & "</td><td>" & strEName & "</td><td>" & strLName & "</td></tr>"

  rs.MoveNext
Loop
        Response.Write "</table><br>"

    End If
    cn.Close
    Set cn = Nothing
%>
</body>
</html>

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.