Jump to content

mckenzie

Members
  • Posts

    54
  • Joined

  • Last visited

Everything posted by mckenzie

  1. well i need to create dev1 as it states it as a task in the assignment. with this user i need to create a new table. i can do this. then i need to take the primary key from this table and put it into the student table and the instructor table as a foreign key. i need to do this connected to the dev1 user. well the code on the topic i have sent i jus copied the privileges that ora1 has and gave them to dev1. it still doesn't work.
  2. i'm oracle 8, i dont know the server but its jus in my college. this is the only thing i havent gotten to work. i f icreate the tables using dev1 i can do this easily but i have to create the univeristy table with dev1 and all the rest wiv ora1. on this topic is all the tables i had to create wiv ora1http://w3schools.invisionzone.com/index.php?showtopic=4969
  3. how do i do that? the system was made using ora1. system manager should be the major guy wiv all the privileges. i have given privileges all ova the place to all so am gettin frustrated.
  4. ALTER TABLE instructor ADDCONSTRAINT instructor_FK1FOREIGN KEY (UNI_ID)REFERENCES dev1.UNIVERSITY (UNI_ID)i'm getting insufficient privileges for this statement.what privileges do i need to giv myself. there are 3 userssystemora1dev1
  5. mckenzie

    Feedback page

    Hi there, i have a problem with the insert into statement. Microsoft JET Database Engine (0x80040E14)Syntax error in INSERT INTO statement./cmpweb11/mckenzie/confirmation.asp, line 54This is my feedback page. html><head> <title>MCKENZIE'S</title></head><body bgcolor="#FFFFFF"> <table border="0" width="900" cellspacing="0" cellpadding="0" height="476"> <tr> <td colspan="2" valign="top" width="900" height="89"> <table border="0" width="100%" height="82"> <tr> <!--#include File="header.asp"--> </tr> </table> </td> </tr> <tr> <td width="120" valign="top" height="442"><table border="0" width="90" cellspacing="0" cellpadding="2"> <tr> <!--#include File="leftnavbar.asp"--> </tr> </table> <td width="500" valign="top" height="442"> <table border="0" width="100%" height="436"> <tr> <td width="100%" height="430"> <table width="400" cellpadding="4" cellspacing="4" border="0" align="left" class="text3"> <tr> <td colspan="2" align="center"><h4>Feedback Page</h4> <span class="text5">[Fields in red are required]</span></td> </tr> <form action="confirmation.asp" method="goto" id=feedback name=feedback> <tr> <td width="160" valign="top" align="left" class="text5">LastName:</td> <td valign="top" align="left"><input type="text" name="lname" maxlength="255" size="20" value=""></td> </tr> <tr> <td width="160" valign="top" align="left" class="text5">FirstName:</td> <td valign="top" align="left"><input type="text" name="fname" maxlength="255" size="20" value=""></td> </tr> <tr> <td width="160" valign="top" align="left" class="text5">Your e-mail address:</td> <td valign="top" align="left"><input type="text" name="email" size="30" value="e-mail"></td> </tr> <tr> <td width="160" valign="top" align="left">Telephone No:</td> <td valign="top" align="left"><input type="text" name="Tel" maxlength="255" size="20" value=""></td> </tr> <tr> <td width="160" valign="top" align="left">Age:</td> <td valign="top" align="left"><input type="text" name="Age" maxlength="3" size="5" value=""></td> </tr> <tr> <td width="160" valign="top" align="left">######:</td> <td valign="top" align="left"><input type="radio" name="######" value="Male">Male <input type="radio" name="######" value="Female">Female</td> </tr> <tr> <td colspan="2" width="400" class="text5"><b>[Please rate the following...]</b> </tr> <tr> <td width="400" valign="top" align="left" class="text5">Sites Helpfullness?</td> <td valign="top" align="left"><select name="helpfulness"> <option value="-">Please Choose...</option> <option value="Very Poor">Very Poor </option> <option value="Poor">Poor </option> <option value="Average">Average </option> <option value="Good">Good </option> <option value="Very Good">Very Good </option> <option value="Excellent">Excellent </option> </select> </td> </tr> <tr> <td width="220" valign="top" align="left" class="text5">Sites Visual Appeal?</td> <td valign="top" align="left"><select name="visual_appeal"> <option value="-">Please Choose...</option> <option value="Very Poor">Very Poor </option> <option value="Poor">Poor </option> <option value="Average">Average </option> <option value="Good">Good </option> <option value="Very Good">Very Good </option> <option value="Excellent">Excellent </option> </select> </td> </tr> <tr> <td width="220" valign="top" align="left" class="text5">Sites Ease of Use?</td> <td valign="top" align="left"><select name="use"> <option value="-">Please Choose...</option> <option value="Very Poor">Very Poor </option> <option value="Poor">Poor </option> <option value="Average">Average </option> <option value="Good">Good </option> <option value="Very Good">Very Good </option> <option value="Excellent">Excellent </option> <option value="-"> </option> </select> </td> </tr> <tr> <td width="300" valign="top" align="left" class="text5">Sites Overall Quality?</td> <td valign="top" align="left"><select name="quality"> <option value="-">Please Choose...</option> <option value="Very Poor">Very Poor </option> <option value="Poor">Poor </option> <option value="Average">Average </option> <option value="Good">Good </option> <option value="Very Good">Very Good </option> <option value="Excellent">Excellent </option> </select> </td> </tr> <tr> <td colspan="2" width="400" class="text5"><b>[Any further improvements or suggestions?]</b> </tr> <tr> <td width="220" valign="top" align="left" class="text5">Write here:</td> <td valign="top" align="left"><input type="text" name="Suggestions" maxlength="500" size="50" value=""></td> </tr> <tr> <td valign="top" colspan="2"> <input name="intColumn2" type="checkbox" id="further info checkbox" value="1" checked> Please indicate here whether or not you would like to receive information from us or our partners.</td> </tr> <tr> <td colspan="2" valign="top"> Instructions for removal are included in every e-mail.</td> </tr> <tr> <td colspan="2" valign="top" align="center"> <a href="http://confirmation.htm"> <input type="submit" value="SUBMIT" name="confirmation.htm"> </a> </tr> </form> <tr> <td align="right"><A href="#top"><b>Back to top</b></a></td> </tr> </table><td width = "140" valign="top"></td> </td> </tr> </table> </body> This is my confirmation page <html><head> <title>MCKENZIE'S</title></head><body bgcolor="#FFFFFF"> <table border="1" width="900" cellspacing="0" cellpadding="0" height="476"> <tr> <td colspan="2" valign="top" width="774" height="89"> <table border="1" width="100%" height="82"> <tr> <!--#include File="header.asp"--> </tr> </table> </td> </tr> <tr> <td width="90" valign="top" height="442"><table border="0" width="90" cellspacing="0" cellpadding="2"> <tr> <!--#include File="leftnavbar.asp"--> </tr> </table> <td width="500" valign="top" height="442"> <table border="1" width="100%" height="436"> <tr> <td width="" height="430"><% dim conn set conn = Server.CreateObject("ADODB.connection") conn.Open "PROVIDER=Microsoft.jet.oledb.4.0;DATA SOURCE=" & server.MapPath("Project1.mdb") & ";" dim id id = request("id") dim sql 'step 1 - make sql statement Sql = "insert into FEEDBACK(lastname, firstname, email, telephone, age, ######, helpfullness, appeal, use, quality, suggestions, focus)" Sql = Sql & "values('" & request("lname") & "'," Sql = Sql & "'" & request("fname") & "'," Sql = Sql & "'" & request("email") & "'," Sql = Sql & "'" & request("tel") & "'," Sql = Sql & request("age") & ", " Sql = Sql & "'" & request("######") & "'," Sql = Sql & "'" & request("helpfulness") & "'," Sql = Sql & "'" & request("visual_appeal") & "'," Sql = Sql & "'" & request("use") & "'," Sql = Sql & "'" & request("quality") & "'," Sql = Sql & "'" & request("suggestions") & "'," response.write "sql=" & sql conn.execute(sql) %> <table width="400" cellpadding="10" cellspacing="10" border="0" align="left" class="text3"> <tr> <td align="center"><h2>THANKYOU FOR YOUR CONTRIBUTION!</h2><br><br></td> </tr> <tr> <td align="center"><h3>Your Comments will be examined carefully</h3></td> </tr> <tr> <td align="center" class="text1"><h4>Click <a href="default.asp" title="Home Page"><b>here</b></a> to return to the Home Page</<h4></td> </tr> </table> <td width = "140" valign="top"></td> </td> </tr> </table> </body> Ive checked the names of the tables being inserted into and i'm just in Limbohelp
  6. The address of the university is formatted as address_type e.g. streetcitycountrywould the syntax recommended be appropriate still?The uni ID is a foreign key in both the student and lecture tables (if you need to know that)
  7. ok thank god we got that code box thing out the way, phew was that a hum-dinger of a problem now back to adding 2 users and granting readonly access to 3 tables where they are linked to uk universtities. any clues? i'll be on here all nite. yep setting upcamp!
  8. yeh that would've been a good idea. I'm a bit behind on my SQL so just rushed the post. This forum seems to calm me down so u won't get anymore of that wild posting out of me. With this task i have to add 2 users, ones called dev1 and the other ukacademic1. dev1 has a password named dev1 and ukacademic1 has a password ukacc1. dev1 has unlimited access but ukacademic1 has only the read only access to a view of the student, instructor and university tables but be restricted to the students/ instructors who have links with UK universities. how would i go about doing this?
  9. sorry if this cheeky to put all this on here. jus didnt know who to ask. bit unprofessional iknow
  10. hi there i've been given a task to change the following script to create a new user, dev1 with password dev1 who has unlimited access. I have to create another table called university that has ID, name, address, number of students, date of frst contact! i have been trying but not getting anywhere. it seems fairly simple to do by copy and apstgin the original script and changing the names.the underlined code is what i attempted. i try the user thing but fail. spool dbcre8.logconnect system/managerdrop user ora1 cascade;drop user ora2 cascade;create user ora1 identified by ora1;grant create session to ora1;grant create table to ora1;grant create view to ora1;grant create sequence to ora1;grant create synonym to ora1;grant create procedure to ora1;grant create trigger to ora1;grant create cluster to ora1;grant create type to ora1;alter user ora1 quota unlimited on system;drop user ora2 cascade;create user ora2 identified by ora2;grant create session to ora2;grant create table to ora2;grant create view to ora2;grant create sequence to ora2;grant create synonym to ora2;grant create procedure to ora2;grant create trigger to ora2;grant create type to ora2;grant create cluster to ora2;alter user ora2 quota unlimited on system;connect ora1/ora1CREATE OR REPLACE TYPE address_type AS OBJECT (street VARCHAR2(25),city VARCHAR2(25),country VARCHAR2(20) )/CREATE TABLE person_address OF address_type;CREATE TABLE student ( student_id number(4) not null, student_fname varchar2(10) not null, student_lname varchar2(12) not null, address REF address_type SCOPE IS person_address, tel_no varchar2(15), fax_no number(15), gender varchar2(1), date_of_birth date, student_desc varchar2(250), preferred_language varchar2(2), passport_program varchar2(1), company_id number(2) not null);CREATE TABLE company ( company_id number(2) not null, company_name varchar2(15), city varchar2(12), industry varchar2(15), no_employees number(5), revenue number(10), training_budget number(6));CREATE TABLE instructor ( instructor_id number(3) not null, instructor_name varchar2(15) not null, address REF address_type SCOPE IS person_address, salary number(6,2), commission number(6,2), mentor_id number(3), date_hired date, profile CLOB);CREATE TABLE course ( course_id number(3) not null, title varchar2(30), duration number(2), cost number(5), subject_id number(2), brochure bfile);CREATE TABLE authorization ( instructor_id number(3) not null, course_id number(3) not null, auth_date date);CREATE TABLE subject_area ( subject_id number(2) not null, subject_name varchar2(30));CREATE TABLE offering ( offering_id number(5) not null, course_id number(3) not null, site_id number(2) not null, instructor_id number(4), start_date date, max_no_students number(2));[u]CREATE TABLE university ( university_id number(5) not null, name varchar(20), number_of_students number(6), date_of_first_contact date,);[/u]CREATE TYPE classroom_type AS OBJECT(room_number NUMBER(2) ,capacity NUMBER(2) ,description VARCHAR2(200));/CREATE TYPE classroom_varray_type AS VARRAY(50) OF classroom_type;/CREATE TABLE site ( site_id number(2) not null, address address_type, classroom classroom_varray_type, location varchar2(12));CREATE TABLE attendance ( offering_id number(5) not null, student_id number(4) not null, evaluation varchar2(1), amount_paid number(6,2));CREATE OR REPLACE TYPE invoice_item_type AS OBJECT(student_lname VARCHAR2(12) ,course_title VARCHAR2(30) ,start_date DATE ,end_date DATE ,amount NUMBER(7,2) );/CREATE TYPE invoice_item_table_type AS TABLE OF invoice_item_type;/CREATE TABLE invoice(invoice_number NUMBER(6) NOT NULL,company_id NUMBER(2) NOT NULL,billing_date DATE NOT NULL,due_date DATE,invoice_item invoice_item_table_type)NESTED TABLE invoice_item STORE AS invoice_item_table;insert into person_address (street, city, country)values ('111 BAY STATE ROAD', 'BOSTON', 'USA');insert into person_address (street, city, country)values ('111 VALLEY WAY', 'SAN FERNANDO', 'USA');insert into person_address (street, city, country)values ('4545 ORACLE DRIVE', 'SAN FRANCISCO', 'USA');insert into person_address (street, city, country)values ('22 GOLDEN GATE DRIVE', 'SAN FRANCISCO', 'USA');insert into person_address (street, city, country)values ('77 ELM STREET', 'NEWARK', 'USA');insert into person_address (street, city, country)values ('544 42ND STREET', 'NEW YORK', 'USA');insert into person_address (street, city, country)values ('111 BEACHCOMBER PLACE', 'OCEANSIDE', 'USA');insert into person_address (street, city, country)values ('25 MISSION WAY', 'SAN DIEGO', 'USA');insert into person_address (street, city, country)values ('177 AIRPORT ROAD', 'NEWARK', 'USA');insert into person_address (street, city, country)values ('5567 KNIGHTSBRIDGE COURT', 'LONDON', 'UK');insert into person_address (street, city, country)values ('111 CRUISING WAY', 'TORTOLA', 'BVI');insert into person_address (street, city, country)values ('45 KING STREET', 'OTTAWA', 'CANADA');insert into person_address (street, city, country)values ('45555 BIG STREET', 'DALLAS', 'USA');insert into person_address (street, city, country)values ('AVENUE CHAMPS-ELYSEES 456', 'PARIS', 'FRANCE');insert into person_address (street, city, country)values ('562 HOCKEY STREET', 'TORONTO', 'CANADA');insert into person_address (street, city, country)values ('4242 MISTY LANE', 'SEATTLE', 'USA');insert into person_address (street, city, country)values ('KUNGSGATAN 56', 'STOCKHOLM', 'SWEDEN');insert into person_address (street, city, country)values ('11-882 KAMEHAMEHA HIGHWAY', 'HAWAII', 'USA');insert into person_address (street, city, country)values ('333 SAN JUAN BLVD', 'SAN JUAN', 'PUERTO RICO');insert into person_address (street, city, country)values ('7500 IMPERIAL BLVD', 'LOS ANGELES', 'USA');insert into student (student_id, student_fname, student_lname, tel_no, fax_no, gender,date_of_birth, preferred_language, company_id)values (1111, 'DIANE', 'BROWN', '(617)342-2345', 6173422345, 'F', '01-FEB-1964', 'EN', 20);update student set address = (select ref(x) from person_address xwhere x.street='111 BAY STATE ROAD')where student_id = 1111;insert into student (student_id, student_fname, student_lname, tel_no, fax_no, gender,date_of_birth, preferred_language, company_id)values (2299, 'CHRIS', 'ADAMS', '(213)334-2789', 2133342789, 'M', '22-MAR-1965', 'EN', 30);update student set address = (select ref(x) from person_address xwhere x.street='7500 IMPERIAL BLVD')where student_id = 2299;insert into student (student_id, student_fname, student_lname, tel_no, fax_no, gender,date_of_birth, preferred_language, company_id)values (4568, 'KEVIN', 'COX', '(619)433-6845', 6194336845, 'M', '04-DEC-1963', 'EN', 10);update student set address = (select ref(x) from person_address xwhere x.street='25 MISSION WAY')where student_id = 4568;insert into student (student_id, student_fname, student_lname, tel_no, fax_no, gender,date_of_birth, preferred_language, company_id)values (5556, 'JOHN', 'TYLER', '(212)444-9769', 2124449769, 'M', '13-JUN-1966', 'EN', 20);update student set address = (select ref(x) from person_address xwhere x.street='544 42ND STREET')where student_id = 5556;insert into student (student_id, student_fname, student_lname, tel_no, fax_no, gender,date_of_birth, preferred_language, company_id)values (6874, 'NANCY', 'GIBBS', '(714)346-2896', 7143462896, 'F', '15-JUL-1965', 'EN', 10);update student set address = (select ref(x) from person_address xwhere x.street='111 VALLEY WAY')where student_id = 6874;insert into student (student_id, student_fname, student_lname, tel_no, fax_no, gender,date_of_birth, preferred_language, company_id)values (6789, 'JENNY', 'ROSE', '(415)334-2345', 4153342345, 'F', '16-SEP-1963', 'SW', 10);update student set address = (select ref(x) from person_address xwhere x.street='4545 ORACLE DRIVE')where student_id = 6789;insert into student (student_id, student_fname, student_lname, tel_no, fax_no, gender,date_of_birth, preferred_language, company_id)values (1199, 'FRANK', 'NELSON', '(609)345-2346', 6093452346, 'M', '22-APR-1964', 'EN', 20);update student set address = (select ref(x) from person_address xwhere x.street='77 ELM STREET')where student_id = 1199;insert into student (student_id, student_fname, student_lname, tel_no, fax_no, gender,date_of_birth, preferred_language, company_id)values (6263, 'KEN', 'CRICK', '(415)345-2313', 4153452313, 'M', '14-MAR-1965', 'EN', 50);update student set address = (select ref(x) from person_address xwhere x.street='22 GOLDEN GATE DRIVE')where student_id = 6263;insert into student (student_id, student_fname, student_lname, tel_no, fax_no, gender,date_of_birth, preferred_language, company_id)values (3452, 'NIGEL', 'TURNER', '(818)352-2511', 8183522511, 'M', '16-FEB-1962', 'SW', 10);update student set address = (select ref(x) from person_address xwhere x.street='111 BEACHCOMBER PLACE')where student_id = 3452;insert into student (student_id, student_fname, student_lname, tel_no, fax_no, gender,date_of_birth, preferred_language, company_id)values (2346, 'CARL', 'DUDLEY', '(609)223-7890', 6092237890, 'M', '28-NOV-1967', 'EN', 20);update student set address = (select ref(x) from person_address xwhere x.street='5567 KNIGHTSBRIDGE COURT')where student_id = 2346;insert into student (student_id, student_fname, student_lname, tel_no, fax_no, gender,date_of_birth, preferred_language, company_id)values (9842, 'MIKE', 'COOPER', '(713)726-9842', 7137269842, 'M', '18-OCT-1962', 'EN', 50);update student set address = (select ref(x) from person_address xwhere x.street='562 HOCKEY STREET')where student_id = 9842;insert into student (student_id, student_fname, student_lname, tel_no, fax_no, gender,date_of_birth, preferred_language, company_id)values (6901, 'LILY', 'GREEN', '(809)342-9621', 8093429621, 'F', '14-MAY-1964', 'EN', 30);update student set address = (select ref(x) from person_address xwhere x.street='111 CRUISING WAY')where student_id = 6901;insert into student (student_id, student_fname, student_lname, tel_no, fax_no, gender,date_of_birth, preferred_language, company_id)values (7652, 'MARY', 'FRANKS', '(713)234-8521', 7132348521, 'F', '23-DEC-1965', 'EN', 60);update student set address = (select ref(x) from person_address xwhere x.street='45 KING STREET')where student_id = 7652;insert into student (student_id, student_fname, student_lname, tel_no, fax_no, gender,date_of_birth, preferred_language, company_id)values (4631, 'JOE', 'FISHER', '(709)452-7392', 7094527392, 'M', '22-NOV-1962', 'EN', 50);update student set address = (select ref(x) from person_address xwhere x.street='AVENUE CHAMPS-ELYSEES 456')where student_id = 4631;insert into student (student_id, student_fname, student_lname, tel_no, fax_no, gender,date_of_birth, preferred_language, company_id)values (3459, 'LARRY', 'MYERS', '(909)352-6216', 9093526216, 'M', '15-AUG-1967', 'EN', 10);update student set address = (select ref(x) from person_address xwhere x.street='4242 MISTY LANE')where student_id = 3459;insert into student (student_id, student_fname, student_lname, tel_no, fax_no, gender,date_of_birth, preferred_language, company_id)values (6738, 'NICK', 'CARTER', '(808)238-2358', 8082382358, 'M', '17-FEB-1964', 'EN', 20);update student set address = (select ref(x) from person_address xwhere x.street='11-882 KAMEHAMEHA HIGHWAY')where student_id = 6738;insert into student (student_id, student_fname, student_lname, tel_no, fax_no, gender,date_of_birth, preferred_language, company_id)values (8390, 'CAROL', 'WOOD', '(809)342-2345', 8093422345, 'F', '01-MAR-1964', 'EN', 60); update student set address = (select ref(x) from person_address xwhere x.street='KUNGSGATAN 56')where student_id = 8390;insert into student (student_id, student_fname, student_lname, tel_no, fax_no, gender,date_of_birth, preferred_language, company_id)values (8872, 'DEBBY', 'ARCHER', '(980)247-2349', 9802472349, 'F', '01-SEP-1964', 'EN', 20);update student set address = (select ref(x) from person_address xwhere x.street='333 SAN JUAN BLVD')where student_id = 8872;insert into student (student_id, student_fname, student_lname, tel_no, fax_no, gender,date_of_birth, preferred_language, company_id)values (6474, 'PETER', 'HALL', '(707)843-2346', 7078432346, 'M', '22-FEB-1965', 'EN', 10);update student set address = (select ref(x) from person_address xwhere x.street='45555 BIG STREET')where student_id = 6474;insert into student (student_id, student_fname, student_lname, tel_no, fax_no, gender,date_of_birth, preferred_language, company_id)values (9835, 'PAUL', 'MARKS', '(706)343-2345', 7063432345, 'M', '16-DEC-1964', 'EN', 20);update student set address = (select ref(x) from person_address xwhere x.street='177 AIRPORT ROAD')where student_id = 9835;insert into student (student_id, student_fname, student_lname, tel_no, fax_no, gender,date_of_birth, preferred_language, company_id)values (7777, 'FRED', 'FLINTSTONE', '(747)987-6543', 7478882929, 'M', '04-JUL-1904', 'FR', 70);update student set address = (select ref(x) from person_address xwhere x.street='177 AIRPORT ROAD')where student_id = 7777insert into company (company_id, company_name, city, industry, no_employees, revenue, training_budget)values (10, 'USCABLES', 'WASHINGTON', 'MANUFACTURING', 250, 4000000, 50000);insert into company (company_id, company_name, city, industry, no_employees, revenue, training_budget)values (20, 'KODAK', 'HOUSTON', 'MANUFACTURING', 2500, 10000000, 100000);insert into company (company_id, company_name, city, industry, no_employees, revenue, training_budget)values (30, 'KLM', 'AMSTERDAM', 'SERVICE', 5000, 11000000, 990000);insert into company (company_id, company_name, city, industry, no_employees, revenue, training_budget)values (40, 'HAMBRO', 'LONDON', 'SERVICE', 2000, 6000000, 500000);insert into company (company_id, company_name, city, industry, no_employees, revenue, training_budget)values (50, 'FORD', 'DETROIT', 'MANUFACTURING', 8000, 20000000, 100000);insert into company (company_id, company_name, city, industry, no_employees, revenue, training_budget)values (60, 'CITYBANK', 'BOSTON', 'FINANCE', 3000, 5000000, 200000);insert into company (company_id, company_name, city, industry, no_employees, revenue, training_budget)values (70, 'DISNEY', 'ORLANDO', 'ARTS', 2500, 10000000, 300000);insert into instructor (instructor_id, instructor_name, salary, commission, mentor_id, date_hired)values (835, 'SPARKS', 4000 , 200, 978, '16-DEC-1984');update instructor set address = (select ref(x) from person_address xwhere x.street='177 AIRPORT ROAD')where instructor_id = 835;insert into instructor (instructor_id, instructor_name, salary, commission, mentor_id, date_hired)values (978, 'STEEL', 5000 , 250, 222, '16-JAN-1980');update instructor set address = (select ref(x) from person_address xwhere x.street='177 AIRPORT ROAD')where instructor_id = 978;insert into instructor (instructor_id, instructor_name, salary, commission, mentor_id, date_hired)values (222, 'CAINE', 5500 , 350, NULL, '02-NOV-1976');update instructor set address = (select ref(x) from person_address xwhere x.street='333 SAN JUAN BLVD')where instructor_id = 222;insert into instructor (instructor_id, instructor_name, salary, commission, mentor_id, date_hired)values (243, 'TUCKER', 2000 , NULL, 835, '18-DEC-1990');update instructor set address = (select ref(x) from person_address xwhere x.street='11-882 KAMEHAMEHA HIGHWAY')where instructor_id = 243;insert into instructor (instructor_id, instructor_name, salary, commission, mentor_id, date_hired)values (263, 'JOHNSON', 4000 , NULL, 835, '18-JUL-1992');update instructor set address = (select ref(x) from person_address xwhere x.street='562 HOCKEY STREET')where instructor_id = 263;insert into instructor (instructor_id, instructor_name, salary, commission, mentor_id, date_hired)values (515, 'SHELLEY', 3500 , 200, 700, '20-JAN-1991');update instructor set address = (select ref(x) from person_address xwhere x.street='4242 MISTY LANE')where instructor_id = 515;insert into instructor (instructor_id, instructor_name, salary, commission, mentor_id, date_hired)values (453, 'LODGE', 2500 , 100, 835, '14-SEP-1988');update instructor set address = (select ref(x) from person_address xwhere x.street='4242 MISTY LANE')where instructor_id = 453;insert into instructor (instructor_id, instructor_name, salary, commission, mentor_id, date_hired)values (700, 'WAYNE', 4500 , 300, NULL, '16-MAY-1981');update instructor set address = (select ref(x) from person_address xwhere x.street='AVENUE CHAMPS-ELYSEES 456')where instructor_id = 700;insert into instructor (instructor_id, instructor_name, salary, commission, mentor_id, date_hired)values (628, 'MONROE', 3000 , NULL, 700, '16-JUN-1984');update instructor set address = (select ref(x) from person_address xwhere x.street='5567 KNIGHTSBRIDGE COURT')where instructor_id = 628;insert into instructor (instructor_id, instructor_name, salary, commission, mentor_id, date_hired)values (790, 'NEWMAN', 3100 , 300, 700, '16-DEC-1982');update instructor set address = (select ref(x) from person_address xwhere x.street='544 42ND STREET')where instructor_id = 790;insert into instructor (instructor_id, instructor_name, salary, commission, mentor_id, date_hired)values (795, 'BOGART', 3200 , NULL, 700, '16-DEC-1983');update instructor set address = (select ref(x) from person_address xwhere x.street='111 CRUISING WAY')where instructor_id = 795;insert into instructor (instructor_id, instructor_name, salary, commission, mentor_id, date_hired)values (560, 'LAUREL', 5200 , 200, 978, '16-DEC-1983');update instructor set address = (select ref(x) from person_address xwhere x.street='333 SAN JUAN BLVD')where instructor_id = 560;insert into instructor (instructor_id, instructor_name, salary, commission, mentor_id, date_hired)values (123, 'FLINTSTONE,FRED', 1000 , NULL, 978, '16-JUN-1989');update instructor set address = (select ref(x) from person_address xwhere x.street='177 AIRPORT ROAD')where instructor_id = 123insert into course values (215, 'UNIX', 5, 1995, 10, null);insert into course values (315, 'C++', 5, 1995, 20, null);insert into course values (415, 'ADA', 4, 1500, 20, null);insert into course values (515, 'ORACLE', 5, 1995, 30, null);insert into course values (615, 'SYBASE', 3, 1200, 30, null);insert into course values (115, 'DOS', 1, 500, 10, null);insert into course values (715, 'VMS', 2, 995, 10, null);insert into course values (815, 'NETWARE', 5, 1995, 40, null);insert into course values (915, 'INFORMIX', 3, 1200, 30, null);insert into subject_area values (10, 'SYSTEMS');insert into subject_area values (20, 'LANGUAGES');insert into subject_area values (30, 'DBMS');insert into subject_area values (40, 'NETWORKS');insert into authorization values (222, 315, '14-MAR-1990');insert into authorization values (222, 415, '13-JAN-1992');insert into authorization values (978, 815, '14-MAR-1989');insert into authorization values (700, 315, '14-FEB-1991');insert into authorization values (835, 515, '12-MAR-1992');insert into authorization values (515, 915, '22-APR-1991');insert into authorization values (263, 215, '14-JUN-1992');insert into authorization values (263, 315, '14-FEB-1992');insert into authorization values (453, 615, '14-JUL-1993');insert into authorization values (453, 715, '14-AUG-1993');insert into authorization values (628, 315, '13-JUL-1991');insert into authorization values (790, 315, '14-AUG-1991');insert into site values (1, address_type('3 Place de Concorde','PARIS','FRANCE'),classroom_varray_type (classroom_type (1, 20, null), classroom_type (2, 24, null), classroom_type (3, 30, null)),'Europe Ctr');insert into site values (2, address_type('1600 Pennsylvania','WASHINGTON','USA'),classroom_varray_type (classroom_type (1, 20, null), classroom_type (2, 24, null)), 'US East');insert into site values (3, address_type('22 Trafalgar Square','LONDON','UK'), classroom_varray_type (classroom_type (1, 20, null), classroom_type (2, 24, null), classroom_type (3, 24, null)),'Europe West');insert into site values (4, address_type('Kungsgatan 26','STOCKHOLM','SWEDEN'), classroom_varray_type (classroom_type (1, 20, null)), 'Europe North');insert into site values (5, address_type('343 Elm Street','OTTAWA','CANADA'),classroom_varray_type (classroom_type (1, 20, null), classroom_type (2, 20, null), classroom_type (3, 20, null)), 'Canada Ctr');insert into site values (6, address_type('101 Boylston Street','BOSTON','USA'),classroom_varray_type (classroom_type (1, 20, null), classroom_type (2, 24, null)), 'US East');insert into site values (7, address_type('1010 Sepulveda','LOS ANGELES','USA'),classroom_varray_type (classroom_type (1, 20, null), classroom_type (2, 20, null), classroom_type (3, 20, null)) , 'US West');insert into site values (8, address_type('101 Younge Street','TORONTO','CANADA'), classroom_varray_type (classroom_type (1, 20, null), classroom_type (2, 24, null)), 'Canada South'); insert into offering (offering_id, course_id, instructor_id, site_id, start_date, max_no_students)values (1001, 315, 700, 1, '16-DEC-1994', 24);insert into offering (offering_id, course_id, instructor_id, site_id, start_date, max_no_students)values (1002, 315, 263, 3, '16-JUL-1995', 20);insert into offering (offering_id, course_id, instructor_id, site_id, start_date, max_no_students)values (1003, 915, 560, 7, '23-NOV-1996', 30);insert into offering (offering_id, course_id, instructor_id, site_id, start_date, max_no_students)values (1004, 215, 263, 2, '26-SEP-1995', 24);insert into offering (offering_id, course_id, instructor_id, site_id, start_date, max_no_students)values (1005, 815, 978, 3, '15-OCT-1995', 20);insert into offering (offering_id, course_id, instructor_id, site_id, start_date, max_no_students)values (1006, 915, 560, 4, '04-JAN-1996', 22);insert into offering (offering_id, course_id, instructor_id, site_id, start_date, max_no_students)values (1007, 615, 453, 4, '30-SEP-1995', 30);insert into offering (offering_id, course_id, instructor_id, site_id, start_date, max_no_students)values (1008, 515, 835, 5, '20-JUN-1995', 24);insert into offering (offering_id, course_id, instructor_id, site_id, start_date, max_no_students)values (1009, 315, 790, 4, '21-JUN-1995', 24);insert into offering (offering_id, course_id, instructor_id, site_id, start_date, max_no_students)values (1010, 315, NULL, 4, '30-AUG-1997', 24);insert into attendance values (1001,1111, 4, 1000);insert into attendance values (1002,2299, NULL, 1000);insert into attendance values (1003,4568, 3, 1200);insert into attendance values (1002,6789, 4, 1150);insert into attendance values (1005,9835, 3, 1995);insert into attendance values (1006,9842, 4, 1000);insert into attendance values (1006,1199, 4, 1200);insert into attendance values (1006,3452, 2, 200);insert into attendance values (1007,8390, 4, 1200);insert into attendance values (1007,6474, 4, 900);insert into attendance values (1008,8390, 4, 1000);insert into attendance values (1003,1199, 4, 1000);insert into attendance values (1001,6738, 4, 850);insert into attendance values (1001,5556, 4, 1995);insert into attendance values (1001,6263, 1, 1995);insert into attendance values (1002,2346, 4, 1995);insert into attendance values (1003,6901, 4, 1200);insert into attendance values (1003,7652, 4, 1200);insert into attendance values (1003,4631, 3, 1200);insert into attendance values (1008,3459, 4, 1995);insert into attendance values (1004,2299, 3, 1995);insert into attendance values (1004,6789, 4, 1995);insert into attendance values (1004,6263, 4, 1995);insert into attendance values (1007,9842, 3, 1200);insert into attendance values (1007,4631, 3, 1200);insert into attendance values (1005,6738, 4, 1000);insert into attendance values (1005,3459, 3, 1995);insert into attendance values (1006,6474, 2, 1200);insert into attendance values (1006,9835, 4, 1000);insert into attendance values (1007,9835, 4, 1200);insert into attendance values (1009,3459, 3, 4000);commit;create sequence inv_no_seq start with 10000 ;insert into invoiceselect inv_no_seq.nextval, co.company_id, trunc(sysdate), trunc(sysdate) + 30,CAST (MULTISET(select s.student_lname, c.title, o.start_date , o.start_date + c.duration, a.amount_paidfrom offering o , attendance a, course c, student swhere o.offering_id=a.offering_idand o.course_id = c.course_idand s.student_id = a.student_idand co.company_id = s.company_id) AS INVOICE_ITEM_TABLE_TYPE)FROM COMPANY CO;commit;spool off
  11. hello there, Iam trying to grant a newly created user, access to 3 tables called STUDENT, INSTRUCTOR and UNIVERSITY but be restricted to only those students/instructors who have links with UK universities. Any ideas? I'm new to SQL so will have a stab at it: grant select * from student, instuctor, university where country = 'uk'
  12. Hello Everyone, Quick question but i'm getting data from a db and putting it onto a ASP page. The db data is in the form of currency but the data put on the page goes back to the form of normal number. Someone told me about ASCII codes or summin to solve this problem but i don't really know how to go about implementing this. Any Ideas? Anyone! Anyone!
  13. Out of present range.AddOrder.asp, line 42I don't understand this error sorry if its obvious.This is the code for my addorder page. can anyone help me?<%Dim connDim CmdPopulatefoodDim SQLdim FieldNamedim TableNameset Conn = Server.createobject("ADODB.Connection")conn.open "PROVIDER=Microsoft.jet.OLEDB.4.0;DATA SOURCE=" & server.mappath("Project1.mdb") & ";" Set rs = Server.CreateObject("ADODB.RecordSet")dim fnamedim amntdim totalitemsdim linecostdim totalcostdim orderiddim count count = 0 for i = 1 to 19linecost = 0fname=Request.QueryString("txt" & i)amnt=Request.QueryString("amnt" & i) If fname<>"" Then count = count + 1 Response.Write("Hello " & fname & " X " & amnt & "!<br />") totalitmes = totalitmes + amnt linecost = fname * amnt totalcost = totalcost + linecost End Ifnextif count > 0 then SQL= "SELECT * FROM ORDER_HEAD ;" rs.CursorType = 2 rs.LockType = 3 rs.Open SQL, Conn rs.AddNew rs.Fields("NO OF ITEMS") = totalitmes rs.Fields("TOTAL PRICE") = totalcost rs.Fields("DATE") = date() rs.Update orderid = rs.Fields("ORDER ID") rs.Close SQL= "SELECT * FROM ORDER_DETAILS ;" rs.CursorType = 2 rs.LockType = 3 rs.Open SQL, Conn for i = 1 to 19 linecost = 0 fname=Request.QueryString("txt" & i) amnt=Request.QueryString("amnt" & i) If fname<>"" Then rs.AddNew rs.Fields("ORDER ID") = orderid rs.Fields("ITEMID") = Request.QueryString("Drd1" & i) rs.Fields("QTY") = Request.QueryString("amnt" & i) End If next rs.Update rs.Close Set rs = NothingEnd if %>
  14. ok yeh i know, i know what a dumass i've done it but it won't calcualte it when the page comes up with the quantity already in. so when i click am ite,m from a drop down box the total price won't change
  15. hello there, simple question. it may not be a simple answer. i have this code which calculates the total price of an order. i would like to have the quantity box's to contain the number 1 when the page is brought up. how would i go about doing this?thanks<html><Head><script> function Fn_Drd_Change(Combo, Text) {eval("document.forms(0)."+ Text +".value = document.forms(0)."+ Combo +".value"); }function CalcTotal(){ var total = 0; var Qty = 0; var line = 0; var fld; var fld2; for(var i = 1; i < 19; i++){ Qty = 0; line = 0; eval("fld = document.forms(0).Txt" + i); eval("fld2 = document.forms(0).amnt" + i); if(!isNaN(fld2.value) && fld2.value != ""){ Qty = parseFloat(fld2.value); } if(!isNaN(fld.value) && fld.value != ""){ line = parseFloat(fld.value); } total += (Qty * line) } document.forms(0).myTotalField.value = total;;}</script><%Dim connDim CmdPopulatefoodDim SQLdim FieldNamedim TableNameset Conn = Server.createobject("ADODB.Connection")conn.open "PROVIDER=Microsoft.jet.OLEDB.4.0;DATA SOURCE=" & server.mappath("Project.mdb") & ";" Set rs = Server.CreateObject("ADODB.RecordSet")%><%Sub Fillcombo (TableName, name, price)SQL= "SELECT " & name & " , "& price&" FROM " & TableNamers.Open SQL, connIf Not rs.EOF Then Do While Not rs.EOF %> <Option value=<%= rs("price")%>><%= rs("name")%></Option> <% rs.MoveNext LoopEnd Ifrs.CloseEnd Sub%><body><form method="get" action="AddOrder.asp"><table border="1"><tr><td><Select Name="Drd1" OnChange=" Fn_Drd_Change('Drd1','Txt1')" /><% Call Fillcombo("BAKERYandCAKES", "name","price") %></Select></td><td><INPUT Name="Txt1" Value="" size=6 /></td><td><INPUT type=text Name="amnt1" Value="" size=6 onkeyup="CalcTotal();" /></td></tr><tr><td><Select Name="Drd2" OnChange=" Fn_Drd_Change('Drd2','Txt2')"><% Call Fillcombo("BEERCIDERALCOPOPS", "name","price") %></Select></td><td><INPUT Name="Txt2" Value="" size=6 /></td><td><INPUT type=text Name="amnt2" Value="" size=6 onkeyup="CalcTotal();" /></td></tr><tr><td><Select Name="Drd3" OnChange=" Fn_Drd_Change('Drd3','Txt3')"><% Call Fillcombo("BISCUITSSNACKSandSWEETS", "name","price") %></Select></td><td><INPUT Name="Txt3" Value="" size=6 /></td><td><INPUT type=text Name="amnt3" Value="" size=6 onkeyup="CalcTotal();" /></td></tr><tr><td><Select Name="Drd4" OnChange=" Fn_Drd_Change('Drd4','Txt4')"><% Call Fillcombo("BREAKFASTCEREALS", "name","price") %></Select></td><td><INPUT Name="Txt4" Value="" size=6 /></td><td><INPUT type=text Name="amnt4" Value="" size=6 onkeyup="CalcTotal();" /></td></tr><tr><td><Select Name="Drd5" OnChange=" Fn_Drd_Change('Drd5','Txt5')"><% Call Fillcombo("COOKINGINGREDIENTS", "name","price") %></Select></td><td><INPUT Name="Txt5" Value="" size=6 /></td><td><INPUT type=text Name="amnt5" Value="" size=6 onkeyup="CalcTotal();" /></td></tr><tr><td><Select Name="Drd6" OnChange=" Fn_Drd_Change('Drd6','Txt6')"><% Call Fillcombo("DAIRYEGGSandCHEESE", "name","price") %></Select></td><td><INPUT Name="Txt6" Value="" size=6 /></td><td><INPUT type=text Name="amnt6" Value="" size=6 onkeyup="CalcTotal();" /></td></tr><tr><td><Select Name="Drd7" OnChange=" Fn_Drd_Change('Drd7','Txt7')"><% Call Fillcombo("FRESHFRUIT", "name","price") %></Select></td><td><INPUT Name="Txt7" Value="" size=6 /></td><td><INPUT type=text Name="amnt7" Value="" size=6 onkeyup="CalcTotal();" /></td></tr><tr><td><Select Name="Drd8" OnChange=" Fn_Drd_Change('Drd8','Txt8')"><% Call Fillcombo("FROZENCHIPSandVEG", "name","price") %></Select></td><td><INPUT Name="Txt8" Value="" size=6 /></td><td><INPUT type=text Name="amnt8" Value="" size=6 onkeyup="CalcTotal();" /></td></tr><tr><td><Select Name="Drd9" OnChange=" Fn_Drd_Change('Drd9','Txt1')"><% Call Fillcombo("FROZENDESERTICECREAM", "name","price") %></Select></td><td><INPUT Name="Txt9" Value="" size=6 /></td><td><INPUT type=text Name="amnt9" Value="" size=6 onkeyup="CalcTotal();" /></td></tr><tr><td><Select Name="Drd10" OnChange=" Fn_Drd_Change('Drd10','Txt10')"><% Call Fillcombo("FROZENMEATFISHandPOULTRY", "name","price") %></Select></td><td><INPUT Name="Txt10" Value="" size=6 /></td><td><INPUT type=text Name="amnt10" Value="" size=6 onkeyup="CalcTotal();" /></td></tr><tr><td><Select Name="Drd11" OnChange=" Fn_Drd_Change('Drd11','Txt11')"><% Call Fillcombo("FROZENREADYMEALSPIZZA", "name","price") %></Select></td><td><INPUT Name="Txt11" Value="" size=6 /></td><td><INPUT type=text Name="amnt11" Value="" size=6 onkeyup="CalcTotal();" /></td></tr><tr><td><Select Name="Drd12" OnChange=" Fn_Drd_Change('Drd12','Txt12')"><% Call Fillcombo("MEATFISHandPOULTRY", "name","price") %></Select></td><td><INPUT Name="Txt12" Value="" size=6 /></td><td><INPUT type=text Name="amnt12" Value="" size=6 onkeyup="CalcTotal();" /></td></tr><tr><td><Select Name="Drd13" OnChange=" Fn_Drd_Change('Drd13','Txt13')"><% Call Fillcombo("READYMEALSandPIZZA", "name","price") %></Select></td><td><INPUT Name="Txt13" Value="" size=6 /></td><td><INPUT type=text Name="amnt13" Value="" size=6 onkeyup="CalcTotal();" /></td></tr><tr><td><Select Name="Drd14" OnChange=" Fn_Drd_Change('Drd14','Txt14')"><% Call Fillcombo("READYMEALSandPIZZA", "name","price") %></Select></td><td><INPUT Name="Txt14" Value="" size=6 /></td><td><INPUT type=text Name="amnt14" Value="" size=6 onkeyup="CalcTotal();" /></td></tr><tr><td><Select Name="Drd15" OnChange=" Fn_Drd_Change('Drd15','Txt15')"><% Call Fillcombo("SPIRITS", "name","price") %></Select></td><td><INPUT Name="Txt15" Value="" size=6 /></td><td><INPUT type=text Name="amnt15" Value="" size=6 onkeyup="CalcTotal();" /></td></tr><tr><td><Select Name="Drd16" OnChange=" Fn_Drd_Change('Drd16','Txt16')"><% Call Fillcombo("TINSPACKETSandJARS", "name","price") %></Select></td><td><INPUT Name="Txt16" Value="" size=6 /></td><td><INPUT type=text Name="amnt16" Value="" size=6 onkeyup="CalcTotal();" /></td></tr><<tr><td><Select Name="Drd17" OnChange=" Fn_Drd_Change('Drd17','Txt17')"><% Call Fillcombo("VEGSALADSandDIPS", "name","price") %></Select></td><td><INPUT Name="Txt17" Value="" size=6 /></td><td><INPUT type=text Name="amnt17" Value="" size=6 onkeyup="CalcTotal();" /></td></tr><tr><td><Select Name="Drd18" OnChange=" Fn_Drd_Change('Drd18','Txt18')"><% Call Fillcombo("WINES", "name","price") %></Select></td><td><INPUT Name="Txt18" Value="" size=6 /></td><td><INPUT type=text Name="amnt18" Value="" size=6 onkeyup="CalcTotal();" /></td></tr><tr><td><input type="submit" value="Submit"><input id="myTotalField" type="text" /></td></tr></table></form></body></html>
  16. hello there jus wondering if anyone could help me on this problem i have. I've got a we page that displays 18 drop down boxes that show diferent items from a databse. when the items within the drop down boxes are clicked the price of the items appear next to them in the text boxes. i would like to put a quantity of items in and a total price that changes with every change of the form. how woul og go about doing this? this is my code:<html><Head><script> function Fn_Drd_Change(Combo, Text) {eval("document.forms(0)."+ Text +".value = document.forms(0)."+ Combo +".value"); }</script><%Dim connDim CmdPopulatefoodDim SQLdim FieldNamedim TableNameset Conn = Server.createobject("ADODB.Connection")conn.open "PROVIDER=Microsoft.jet.OLEDB.4.0;DATA SOURCE=" & server.mappath("Project.mdb") & ";" Set rs = Server.CreateObject("ADODB.RecordSet")%><%Sub Fillcombo (TableName, name, price)SQL= "SELECT " & name & " , "& price&" FROM " & TableNamers.Open SQL, connIf Not rs.EOF Then Do While Not rs.EOF %> <Option value=<%= rs("price")%>><%= rs("name")%></Option> <% rs.MoveNext LoopEnd Ifrs.CloseEnd Sub%><body><table border="1"><tr><td><form method="POST" action="default.asp"><P><Select Name="Drd1" OnChange=" Fn_Drd_Change('Drd1','Txt1')"><% Call Fillcombo("BAKERYandCAKES", "name","price") %></Select><INPUT Name="Txt1" Value=""></p><P><Select Name="Drd2" OnChange=" Fn_Drd_Change('Drd2','Txt2')"><% Call Fillcombo("BEERCIDERALCOPOPS", "name","price") %></Select><INPUT Name="Txt2" Value=""></P><P><Select Name="Drd3" OnChange=" Fn_Drd_Change('Drd3','Txt3')"><% Call Fillcombo("BISCUITSSNACKSandSWEETS", "name","price") %></Select><INPUT Name="Txt3" Value=""></P><P><Select Name="Drd4" OnChange=" Fn_Drd_Change('Drd4','Txt4')"><% Call Fillcombo("BREAKFASTCEREALS", "name","price") %></Select><INPUT Name="Txt4" Value=""></P><P><Select Name="Drd5" OnChange=" Fn_Drd_Change('Drd5','Txt5')"><% Call Fillcombo("COOKINGINGREDIENTS", "name","price") %></Select><INPUT Name="Txt5" Value=""></P><P><Select Name="Drd6" OnChange=" Fn_Drd_Change('Drd6','Txt6')"><% Call Fillcombo("DAIRYEGGSandCHEESE", "name","price") %></Select><INPUT Name="Txt6" Value=""></P><P><Select Name="Drd7" OnChange=" Fn_Drd_Change('Drd7','Txt7')"><% Call Fillcombo("FRESHFRUIT", "name","price") %></Select><INPUT Name="Txt7" Value=""></P><P><Select Name="Drd8" OnChange=" Fn_Drd_Change('Drd8','Txt8')"><% Call Fillcombo("FROZENCHIPSandVEG", "name","price") %></Select><INPUT Name="Txt8" Value=""></P><P><Select Name="Drd9" OnChange=" Fn_Drd_Change('Drd9','Txt9')"><% Call Fillcombo("FROZENDESERTICECREAM", "name","price") %></Select><INPUT Name="Txt9" Value=""></P><P><Select Name="Drd10" OnChange=" Fn_Drd_Change('Drd10','Txt10')"><% Call Fillcombo("FROZENMEATFISHandPOULTRY", "name","price") %></Select><INPUT Name="Txt10" Value=""></P><P><Select Name="Drd11" OnChange=" Fn_Drd_Change('Drd11','Txt11')"><% Call Fillcombo("FROZENREADYMEALSPIZZA", "name","price") %></Select><INPUT Name="Txt11" Value=""></P><P><Select Name="Drd12" OnChange=" Fn_Drd_Change('Drd12','Txt12')"><% Call Fillcombo("MEATFISHandPOULTRY", "name","price") %></Select><INPUT Name="Txt12" Value=""></P><P><Select Name="Drd13" OnChange=" Fn_Drd_Change('Drd13','Txt13')"><% Call Fillcombo("READYMEALSandPIZZA", "name","price") %></Select><INPUT Name="Txt13" Value=""></P><P><Select Name="Drd14" OnChange=" Fn_Drd_Change('Drd14','Txt14')"><% Call Fillcombo("READYMEALSandPIZZA", "name","price") %></Select><INPUT Name="Txt14" Value=""></P><P><Select Name="Drd15" OnChange=" Fn_Drd_Change('Drd15','Txt15')"><% Call Fillcombo("SPIRITS", "name","price") %></Select><INPUT Name="Txt15" Value=""></P><P><Select Name="Drd16" OnChange=" Fn_Drd_Change('Drd16','Txt16')"><% Call Fillcombo("TINSPACKETSandJARS", "name","price") %></Select><INPUT Name="Txt16" Value=""></P><P><Select Name="Drd17" OnChange=" Fn_Drd_Change('Drd17','Txt17')"><% Call Fillcombo("VEGSALADSandDIPS", "name","price") %></Select><INPUT Name="Txt17" Value=""></P><P><Select Name="Drd18" OnChange=" Fn_Drd_Change('Drd18','Txt18')"><% Call Fillcombo("WINES", "name","price") %></Select><INPUT Name="Txt18" Value=""></P><input type="submit" value="Submit"></form></td></tr></table></body></html>thankyou
  17. thankyou so much it seems to work fine. when i add more than one drop down box to it, it won't display the price of these but its still better than what i had.thankyou again
  18. where would i put this function and the browser doesn't seem to recognise this { symbol. sorry to be a pain.Here value is right wordCODEfunction Fn_Drd_Change(Combo, Text){ eval("document.forms(0)."+ Text +".value = document.forms(0)."+ Combo +".value");}
  19. shouldn't the "value" be "price". or is this an added variable name?
  20. Helloi've got this code that displays 18 drop down boxes and populaes them wiv 18 tables from an access databse. Within these tables there is 3 fields (id, name, price). i would like to be able to select from a drop down box and have the price of that item displayed to the roght of it!!!! how would i got about doing this?i've seen tutorials on the internet to populate drop down boxes but not to be able to slect from it.?here's my code.sorry about the Drd's at the bottom(a bit of a waist of space)<%Dim connDim CmdPopulatefoodDim SQLdim FieldNamedim TableNameset Conn = Server.createobject("ADODB.Connection")conn.open "PROVIDER=Microsoft.jet.OLEDB.4.0;DATA SOURCE=" & server.mappath("Project.mdb") & ";" Set rs = Server.CreateObject("ADODB.RecordSet")%><%Sub Fillcombo (TableName, name)SQL= "SELECT DISTINCT " & name & " FROM " & (TableName)rs.Open SQL, conn If Not rs.EOF Then Do While Not rs.EOF %> <Option value=<%= rs("name")%>><%= rs("name")%></Option> <% rs.MoveNext LoopEnd Ifrs.CloseEnd Sub%><html><body><form method="POST" action="default.asp"><Select Name="Drd1"><% Call Fillcombo("BAKERYandCAKES", "name") %></Select><p></p><p></p><br> <Select Name="Drd1"><% Call Fillcombo("BEERCIDERALCOPOPS", "name") %></Select><p></p><p></p><br> <Select Name="Drd1"><% Call Fillcombo("BISCUITSSNACKSandSWEETS", "name") %></Select><p></p><p></p><br> <Select Name="Drd1"><% Call Fillcombo("BREAKFASTCEREALS", "name") %></Select><p></p><p></p><br> <Select Name="Drd1"><% Call Fillcombo("COOKINGINGREDIENTS", "name") %></Select><p></p><p></p><br> <Select Name="Drd1"><% Call Fillcombo("DAIRYEGGSandCHEESE", "name") %></Select><p></p><p></p><br> <Select Name="Drd1"><% Call Fillcombo("FRESHFRUIT", "name") %></Select><p></p><p></p><br> <Select Name="Drd1"><% Call Fillcombo("FROZENCHIPSandVEG", "name") %></Select><p></p><p></p><br> <Select Name="Drd1"><% Call Fillcombo("FROZENDESERTICECREAM", "name") %></Select><p></p><p></p><br> <Select Name="Drd1"><% Call Fillcombo("FROZENMEATFISHandPOULTRY", "name") %></Select><p></p><p></p><br> <Select Name="Drd1"><% Call Fillcombo("FROZENREADYMEALSPIZZA", "name") %></Select><p></p><p></p><br> <Select Name="Drd1"><% Call Fillcombo("MEATFISHandPOULTRY", "name") %></Select><p></p><p></p><br> <Select Name="Drd1"><% Call Fillcombo("READYMEALSandPIZZA", "name") %></Select><p></p><p></p><br> <Select Name="Drd1"><% Call Fillcombo("SOFTandHOTDRINKS", "name") %></Select><p></p><p></p><br> <Select Name="Drd1"><% Call Fillcombo("SPIRITS", "name") %></Select><p></p><p></p><br> <Select Name="Drd1"><% Call Fillcombo("TINSPACKETSandJARS", "name") %></Select><p></p><p></p><br> <Select Name="Drd1"><% Call Fillcombo("VEGSALADSandDIPS", "name") %></Select><p></p><p></p><br> <Select Name="Drd1"><% Call Fillcombo("WINES", "name") %></Select><p></p><p></p><br> <input type="submit" value="Submit"></form></body></html>
  21. for an example lets take this code that i got from:http://www.powerasp.com/content/code-snipp...p-down-menu.aspif i wanted to connect to a database and populate 18 drop down boxes on an asp page, how would i go about it? can i choose more than one table in the SQL statement to get information from. your probably thinkin what a silly billy aren't u! Dim DataConnDim CmdPopulateStatesDim SQL Set DataConn = Server.CreateObject("ADODB.Connection")Set CmdPopulateStates = Server.CreateObject("ADODB.Recordset")%><% DataConn.Open "DBQ=" & Server.Mappath("_database/zipcodes.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};" SQL = "SELECT DISTINCT STATE_NAME FROM STATES"CmdPopulateStates.Open SQL, DataConn%><form method="POST" action="somepage.asp"><Select Name="STATE_NAME" size="1"><%While Not CmdPopulateStates.EOF%><option value="<%= CmdPopulateStates("STATE_NAME") %>"><%= CmdPopulateStates("STATE_NAME") %></option><%CmdPopulateStates.MoveNextWend CmdPopulateStates.CloseSet CmdPopulateStates = NothingDataConn.CloseSet DataConn = Nothing%></Select><input type="submit" value="Submit"></form>
  22. when i click an item on the drop down box i want the price to be generated from the database and displayed next to it.how would i go about doin this?here's the code:<% Dim connDim CmdPopulatefoodDim SQL set Conn = Server.createobject("ADODB.Connection")conn.open "PROVIDER=Microsoft.jet.OLEDB.4.0;DATA SOURCE=" & server.mappath("Project.mdb") &";"Set CmdPopulatefood = Server.CreateObject("ADODB.Recordset")%><% SQL = "SELECT name from BAKERYandCAKES "CmdPopulatefood.Open SQL, conn%><form method="POST" action="default.asp"><Select Name="NAME" size="1"><%While Not CmdPopulatefood.EOF%><option value="<%= CmdPopulatefood("NAME") %>"><%= CmdPopulatefood("NAME") %></option><%CmdPopulatefood.MoveNextWend CmdPopulatefood.CloseSet CmdPopulatefood = Nothingconn.CloseSet conn = Nothing%></Select><input type="submit" value="Submit"></form>thankyou
  23. yeh done it, bloody access doesn't recognise "&" symbols for table names. i think!and spaces within the names
  24. <% Dim connDim CmdPopulatefoodDim SQL set Conn = Server.createobject("ADODB.Connection")conn.open "PROVIDER=Microsoft.jet.OLEDB.4.0;DATA SOURCE=" & server.mappath("project.mdb") &";"Set CmdPopulatefood = Server.CreateObject("ADODB.Recordset")%><% SQL = "SELECT NAME FROM BAKERY & CAKES"CmdPopulatefood.Open SQL, conn%><form method="POST" action="default.asp"><Select Name="NAME" size="1"><%While Not CmdPopulatefood.EOF%><option value="<%= CmdPopulatefood("NAME") %>"><%= CmdPopulatefood("NAME") %></option><%CmdPopulatefood.MoveNextWend CmdPopulatefood.CloseSet CmdPopulatefood = Nothingconn.CloseSet conn = Nothing%></Select><input type="submit" value="Submit"></form>
  25. keep getting this error message about my SQL statement.deosn't like the "from" instruction.Syntax error in FROM clause.here's my code for a populated drop down box<% Dim connDim CmdPopulatefoodDim SQL set Conn = Server.createobject("ADODB.Connection")conn.open "PROVIDER=Microsoft.jet.OLEDB.4.0;DATA SOURCE=" & server.mappath("project.mdb") &";"Set CmdPopulatefood = Server.CreateObject("ADODB.Recordset")%><% 'conn.Open "DSN=System_DSN_Name" SQL = "SELECT NAME FROM BAKERY & CAKES"CmdPopulatefood.Open SQL, conn%><form method="POST" action="somepage.asp"><Select Name="NAME" size="1"><%While Not CmdPopulatefood.EOF%><option value="<%= CmdPopulatefood("NAME") %>"><%= CmdPopulatefood("NAME") %></option><%CmdPopulatefood.MoveNextWend CmdPopulatefood.CloseSet CmdPopulatefood = Nothingconn.CloseSet conn = Nothing%></Select><input type="submit" value="Submit"></form>
×
×
  • Create New...