Results 1 to 3 of 3

Thread: CAN ANYONE HELP ME PLEASE??is it possible

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2000
    Posts
    81

    Angry

    how do i create a .asp within Ultradev
    that inserts records into 2 of my tables when i click
    on the submit button
    ie
    my text box fields on the details.asp are

    UserFirstName
    UserSurname
    Email
    ManagerName:
    managersSurname:
    EMail
    ClientNAme
    ClientSurname
    Email

    im using an SQL7 database
    with the following TABLES and fields

    USER
    userid (primarykey)
    managerID (foreignkey)
    ClientID (foriegnkey)
    UserFirstName
    UserSurname
    Email

    MANAGER
    MANAGERID (PrimaryKey)
    ManagerName:
    managersSurname:
    EMail

    CLIENT
    Clientid (primarykey)
    ClientNAme
    ClientSurname
    Email

    i have been stuck on this for days i can insert a record into the user table but it will not allow me to insert into more then one TABLE per page and i have 3 tables i want to inserton on in this page

    please help me out as im really really stuck
    also
    my ID Fields in my database all have primary keys set to
    not allow nulls how do i get my form to increment these values
    each value of
    userid
    managerid
    clientid
    as i insert more records?

    im so verystuck and tried everything i can???
    PLEASE
    PLEASE
    HELP ME OUT

  2. #2
    Fanatic Member Jerry Grant's Avatar
    Join Date
    Jul 2000
    Location
    Dorset, UK
    Posts
    810

    Cool 3 SQL statements

    Ultradev? you mean Interdev?

    Well you need to create SQL statements to insert a new record into each of the three tables.
    A SQL statement can ony insert to one table at a time. so you will have to do 6 SQL statements.
    1. Insert new record into MANAGER table
    2. Select from MANAGER table to get MANAGERID
    3. Insert new record into CLIENT table
    4. Select from CLIENT table to get Clientid
    5. Insert new record into USER table using selected MANAGERID & Clientid
    6. Select from USER table to get userid to do further processing

    This could be in a single stored procedure in the SQL server, though 3 would probably be simpler, due to the parameters which would need to be passed!
    The three tables will need the primary key fields to have identity seeded fields, incrementing by 1. This will allow the fields to generate a unique number on every insert.
    As you are doing this from ASP, do it with Server script. perhaps in a ActiveX.DLL, so to keep it neat.

    Let me know how you get on, and if you need any more assistance
    Jerry Grant................tnarG yrreJ
    Website: <JG-Design></.net>
    Email: [email protected]
    Working towards a bug free world......
    (Not a Microsoft employee)

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Feb 2000
    Posts
    81
    thanks for that i will try that out and let you know
    im using
    dreamweaver ultradec not vb intradev though
    thanks alot for all your help
    cross my fingers it works!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width