www.webdeveloper.com
Page 1 of 12 12311 ... LastLast
Results 1 to 15 of 175

Thread: Insert statement - issues to resolve

  1. #1
    Join Date
    Dec 2002
    Posts
    316

    Insert statement - issues to resolve

    Please help me out urgently!
    I have 3 tables:

    Driver table
    DriverID autonumber int primary key,
    driverName varchar(50),
    workPhone varchar(50),
    homephone varchar(50)

    OtherDriver table
    OtherDriverID autonumber int primary key,
    OtherdriverName varchar(50),
    OtherworkPhone varchar(50),
    Otherhomephone varchar(50)

    Injured table
    InjuredID autoNumber primary key int,
    passenger1 varchar(50),
    age int,
    streetAddress varchar(50),
    city varchar(50),
    state varchar(50),
    zip varchar(50),
    passenger2 varchar(50),
    age int,
    streetAddress varchar(50),
    city varchar(50),
    state varchar(50),
    zip varchar(50),
    passenger3 varchar(50),
    age int,
    streetAddress varchar(50),
    city varchar(50),
    state varchar(50),
    zip varchar(50),
    passenger4 varchar(50),
    age int,
    streetAddress varchar(50),
    city varchar(50),
    state varchar(50),
    zip varchar(50),
    passenger5 varchar(50),
    age int,
    streetAddress varchar(50),
    city varchar(50),
    state varchar(50),
    zip varchar(50)

    I am of course I have more tables like vehicle but what I am having problem with are these 3.
    We are converting manual forms into electric forms.

    Currently, using the manual form, when an accident occurs, a form is filled by completing information about the driver, and slots filled for up five passengers in the car.
    So you a scenario like:
    DriverID,
    age,
    streetAddress ,
    city,
    state,
    zip,
    passenger1,
    age,
    streetAddress ,
    city,
    state,
    zip,
    passenger2
    age,
    streetAddress ,
    city,
    state,
    zip,
    passenger3
    age,
    streetAddress ,
    city,
    state,
    zip,
    passenger4
    age,
    streetAddress ,
    city,
    state,
    zip,
    passenger5
    age,
    streetAddress ,
    city,
    state,
    zip

    What is the best way to handle this situation using asp/form?
    Thank you in advance

  2. #2
    Join Date
    Jan 2003
    Location
    Dundee, Scotland
    Posts
    1,367
    hi,
    first rule of normalization, remove any repeating fields and create a new relation/table for each set of data.

    age, city, state, zip are repeating fields. Street Address can possible be normalized further by splitting houseNumber and StreetAddress and then making a relation/table for streetaddress.
    I would certainly create a new relation/table for age, city, state and zip.

    Injured table
    InjuredID autoNumber primary key int,
    VehicleID foreign key int,
    passenger varchar(50),
    AgeID foreign key int,
    CityID foreign key int,
    StateID foreign key int,
    ZipID foreign key int,

    Age Table
    AgeID autoNumber primary key int,
    Age int,

    City Table
    CityID autoNumber primary key int,
    City varchar(50),
    StateID foreign key int,

    State Table
    StateID autoNumber primary key int,
    State varchar(50),

    Zip Table
    ZipID autoNumber primary key int,
    ZipCode varchar(8),
    CityID foreign key int,

    Sorry to take you away from your original question, personally i feel under your present database structure you are going to find it very hard to write any code. Once you have you're database fix i am sure one of us will be able to give you some code to get you started.

  3. #3
    Join Date
    Dec 2002
    Posts
    316
    hi Dave and ]SWR] Ribeyed!
    Thanks to both of you for your input.
    Now I can understand normalizing the Injured table further, for instance, adding an InjuredType such as
    InjuredType
    InjuredTypeID
    InjuredTypeName

    then have InjuredTypeID in the Injured table.
    But don't you think it is a bit overnormalizing when you break them up like these:

    Age Table
    AgeID autoNumber primary key int,
    Age int,

    City Table
    CityID autoNumber primary key int,
    City varchar(50),
    StateID foreign key int,

    State Table
    StateID autoNumber primary key int,
    State varchar(50),

    Zip Table
    ZipID autoNumber primary key int,
    ZipCode varchar(8),
    CityID foreign key int

  4. #4
    Join Date
    Jan 2003
    Location
    Dundee, Scotland
    Posts
    1,367
    hi,
    lol, "over normalized" normalization is a technique. When we design a database for a relational system, the main objective in developing a logical data model is to create an accurate representation of the data, its relationships, and constraints. To achieve this objective, we must identify a suitable set of relations. A technique that we use to help identify such relations is called normalization.
    A major aim of relational database design is to group attributes into relations so as to minimize data redundancy and thereby reduce the file storage space required by the implemented base relations.
    Relations that have redundant data may have problems called update anomalies, which are classified as insertion, deletion or modification anomalies.
    The database structure you posted would have insertion anomalies to start with. You can insert into the injured table a record about an injury without any relating record in the Driver table. This is bad.
    Your database would also have deletion anomalies. If you deleted a record from the driver table you would have a record left in the otherdriver table, this would cause problems.
    And again your database would have modification anomalies. If driver 1 changed his details and he was in an accident if you changed his details in the driver table you would be left with the old details in the injured table.
    You would have more problems when it comes to inserting into the database with your injured table. You have 4 age, streetaddress, state, city etc. in the one table, there are many reasons why this is not done, one would be; it would not know which one you want to insert data into. Say I said
    state = "Mississippi"
    Then if you inserted this into the database it would know which state field to write to.
    The driver and otherdriver tables are not normalized you should have 1 table for all drivers and another table that will hold information about which driver, first or second, they are.
    so something like this would be normalized:

    driver table
    DriverID autoNumber primary key int,
    DriverName varchar(50),
    TypeID foreign key int,

    DriverType table
    TypeID autoNumber primary key int,
    DriverType varchar(50),

    Hope this helps

  5. #5
    Join Date
    Dec 2002
    Posts
    316
    Impressive lesson on rules of normalization.
    I thought I know it atleast to the 3rd normal form.
    F.C Codd must be turning in his sleep now.
    Anyway taking further, here is my full design in relation to the accident project.

    Damage table (this is damage to car and has prepoluated data from police dept)
    damageId int primary,
    DamageDesc varchar(1000)
    eg damageId DamageDesc
    1 total damage

    Collision table (two cars involbed also prepopulated from police dept)
    collisionID int primary key,
    CollisionDesc varchar(1000)
    eg
    collisionID collisionDesc
    1 bumper to bumper

    your modifications:

    driver table
    DriverID autoNumber primary key int,
    DriverName varchar(50),
    TypeID foreign key int,
    accidentEventID int (from accidentEvent table)


    DriverType table
    TypeID autoNumber primary key int,
    DriverType varchar(50),

    InjuredType
    InjuredTypeID
    InjuredTypeName

    Age Table
    AgeID autoNumber primary key int,
    Age int

    City Table
    CityID autoNumber primary key int,
    City varchar(50),
    StateID foreign key int

    State Table
    StateID autoNumber primary key int,
    State varchar(50)

    Zip Table
    ZipID autoNumber primary key int,
    ZipCode varchar(8),
    CityID foreign key int

    DriverConditon table (also prepopulated and taken from police dept. This determines if the driver is under influence of alcohol or something.
    conditionID in primary key,
    conditionDesc varchar(1000)

    Notice that all those with prepopulated data do not have autoNumbers.

    Police table
    policeBadgeId int primary key autonumber
    officersName varchar(50),
    dept varchar(50),
    caseNumber int,
    accidentEventID int (from accidentEvent table)

    factors table (contributing factors to the accident, again prepoluated and taken from the police dept)
    factorsID int primary key,
    factorsDesc varchar(1000),

    eg,
    factorsID factorsDesc
    1 failed to yield

    insurance table
    insuranceId autonumber int primary key,
    insuranceCo varchar(50),
    accidentEventID int (from accidentEvent table)

    workmansComp table
    compID int primary key autoNumber,
    name varchar(50),
    dept varchar(50),
    agent varchar(50),
    accidentEventID int (from accidentEvent table)

    Location table (location of accident)
    locationID int primary key autonumber,
    locationDesc varchar(100),
    accidentEventID int (from accidentEvent table)

    vehicle table
    vehicleID int primary key autoNumber,
    LicenceNumber varchar(1000),
    make varchar(50),
    Model varchar(50),
    vehicleYr varchar(50),
    accidentEventID int (from accidentEvent table)

    weather table (also prepopulated and taken from police dept)
    weatherID int primary key,
    weatherDesc varchar(1000)
    eg:
    weatherID weatherDesc
    1 clear


    The main table
    AccidentEvent table
    accidentEventID int autoNumber, primary Key,
    condID int (from driverCondition table),
    factorsID int (from factorstable),
    compID int (from workmansComp table),
    collisionID (from Collision table),
    damageId (from damage table),
    weatherId (from weather table),
    comments varchar(2000),
    drugtest varchar(50),
    result varchar(1000),
    atfault varchar(50)

    This is basically what I have as far as design is concerned.
    I know this is a lot of information to digest but take a look and see if there are any additonal design changes to be made.
    Thanks to you folks again

  6. #6
    Join Date
    Jan 2003
    Location
    Dundee, Scotland
    Posts
    1,367
    hi,
    can you post the form you have for taking input from the user?

  7. #7
    Join Date
    Dec 2002
    Posts
    316
    hi [SWR]Ribeyed
    This is what I have so far. It is not very respectable right now because of the problem I was having that led to my original posting.

    <%
    '-----------------------------------------------------------------------------------
    '
    '-----------------------------------------------------------------------------------
    Function Display_EventInsert(strGrid)
    %>
    <html>
    <head>
    <title>Insert Event</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body>
    <form name="Insert" method="post" action="">
    <p>Event location:</p>
    <p>
    <input name="txtEventLocation" type="text" maxlength="50" value="<%request.form("txtEventLocation")%>">
    </p>
    <p>Event description:</p>
    <p>
    <textarea name="txtEventDescr" cols="40" rows="7" value="<%request.form("txtEventDescr")%>"></textarea>
    </p>
    <p>Involved persons:</p>
    <table width="57%" border="0" cellspacing="0" cellpadding="0">
    <tr>
    <td>Name</td>
    <td>Age</td>
    <td>Location</td>
    <td>Type</td>
    </tr>
    <%response.write(strGrid)%>
    </table>
    </form>
    </body>
    </html>
    <%
    End Function
    '-----------------------------------------------------------------------------------
    '
    '-----------------------------------------------------------------------------------
    Function BuildPersonTypeMenu(intSelection, intCount)
    '-----------------------------------------------------
    'build ADODB.Connection here, should be called "objConn"
    set objConn = Server.CreateObject("ADODB.Connection")
    objConn.Open "" 'accident'
    '-----------------------------------------------------

    'retrieve all availble Injured types from database
    '--------------------------------------
    strSQL = "SELECT * FROM injuredType"
    set rsData = Server.CreateObject("ADODB.Recordset")
    rsData.Open strSQL, objConn
    '--------------------------------------

    'start building the menu as strMenu. intCount is used to keep the menu
    'value unique in the grid:
    strMenu = "<select name=""lstinjuredTypeMenu"""&intCount&">"& vbNewLine

    Do While Not rsData.EOF
    strMenu = strMenu &"<option value="
    strMenu = strMenu & rsData("TypeID")
    'check if there was selected a value before. If so, make sure it's displayed
    'as selected, so the user does not have to re-select that value, every time a
    'line is added to the grid
    If intSelection <> 0 and CInt(rsData("TypeID")) = Cint(intSelection) then
    strMenu = strMenu & " selected>"
    else
    strMenu = strMenu & ">"
    end if
    strMenu = strMenu & rsData("TypeName")
    strMenu = strMenu & "</option>"&vbNewLine
    rsData.MoveNext
    loop

    strMenu = strMenu & "</select>"& vbNewLine

    'kill the recordset
    rsData.close
    set rsData = nothing

    'kill the connection
    objConn.close
    set objConn = nothing

    'asign the menu to return value function
    BuildInjuredTypeMenu = strMenu
    End Function
    '-----------------------------------------------------------------------------------
    '
    '-----------------------------------------------------------------------------------
    Function Build_PersonGrid(strGrid)
    Dim intCount, x

    If request.form("Count") = "" then
    'set default number of lines in the grid, in this case 5(!)
    intCount = 4
    else
    'retrieve current amount of lines in the grid, increment by 1
    intCount = Cint(request.form("Count") + 1)
    end if

    For x = 0 To intCount
    strGrid = strGrid & "<tr>" & vbNewLine
    strGrid = strGrid & "<td><input name=""txtPersonName"""&intCount&" type=""text"" maxlength=""50"" value="""&request.form("txtPersonName"&intCount)&"""></td>"& vbNewLine
    strGrid = strGrid & "<td><input name=""txtPersonAge"""&intCount&" type=""text"" maxlength=""50"" value="""&request.form("txtPersonAge"&intCount)&"""></td>"& vbNewLine
    strGrid = strGrid & "<td><input name=""txtLocation"""&intCount&" type=""text"" maxlength=""50"" value="""&request.form("txtLocation"&intCount)&"""></td>"& vbNewLine
    strGrid = strGrid & "<td>"
    If request.form("lstinjuredTypeMenu") <> "" then
    strGrid = strGrid & ""& BuildinjuredTypeMenu(request.form("lstInjuredTypeMenu"&intCount), intCount)
    else
    strGrid = strGrid & ""& BuildPersonTypeMenu(0, intCount)
    End If
    strGrid = strGrid & "</td>"& vbNewLine
    strGrid = strGrid & "</tr>"& vbNewLine

    'set new Count, and action
    strGrid = strGrid & "<input type=""hidden"" name=""Count"" value="""&intCount&""">"&vbNewLine
    strGrid = strGrid & "<input type=""submit"" name=""cmd_AddNewLine"" value=""Add"">"& vbNewLine
    strGrid = strGrid & "<input type=""submit"" name=""cmd_Process"" value=""Process"">"& vbNewLine
    Next

    Build_InjuredGrid = strGrid
    End Function
    '-----------------------------------------------------------------------------------
    '
    '-----------------------------------------------------------------------------------
    Sub Process_InsertEvent
    Dim strSQL, intCount, x

    intCount = request.form("Count")

    '-----------------------------------------------------
    'build ADODB.Connection here, should be called "objConn"
    set objConn = Server.CreateObject("ADODB.Connection")
    objConn.Open "" 'accident'
    '-----------------------------------------------------

    'insert the event data
    strSQL = "INSERT INTO accidentEvents( "
    strSQL = strSQL & "EventLocation, "
    strSQL = strSQL & "EventDescription) "
    strSQL = strSQL & "VALUES("
    strSQL = strSQL & ""&request.form("txtEventLocation")&""
    strSQL = strSQL & ""&request.form("txtEventDescr")&")"
    objConn.execute(strSQL)

    strSQL = "SELECT MAX(EventID) AS NewEvent FROM accidentEvents"
    set rsData = objConn.execute(strSQL)

    intNewEventID = rsData("NewEvent")

    rsData.close
    set rsData = nothing

    'insert the involved persons, from grid
    For x = 0 To intCount
    strSQL = "INSERT INTO injured( "
    strSQL = strSQL & "Name,"
    strSQL = strSQL & "Age,"
    strSQL = strSQL & "City,"
    strSQL = strSQL & "injuredType, "
    strSQL = strSQL & "AccidentID) "
    strSQL = strSQL & "VALUES( "
    strSQL = strSQL & ""&request.form("txtPersonName"&intCount)&","
    strSQL = strSQL & ""&request.form("txtPersonAge"&intCount)&","
    strSQL = strSQL & ""&request.form("txtLocation"&intCount)&","
    strSQL = strSQL & ""&request.form("lstinjuredTypeMenu"&intCount)&","
    strSQL = strSQL & ""&intNewEventID&")"
    objConn.execute(strSQL)
    Next

    objConn.close
    set objConn = nothing

    response.write("Action was a succes. All data was processed in database")

    End Sub
    '-----------------------------------------------------------------------------------
    '
    '-----------------------------------------------------------------------------------
    Sub Main
    Dim intAction

    If request.form("cmd_AddNewLine") <> "" then
    intAction = Cint(0)
    elseif request.form("cmd_Process") <> "" then
    intAction = Cint(1)
    Else
    intAction = Cint(0)
    end if

    Select Case intAction
    Case 0
    strGrid = Build_injuredGrid(strTemp)
    Display_EventInsert(strGrid)
    Case 1
    Process_InsertEvent
    End Select
    End Sub
    '-----------------------------------------------------------------------------------
    '
    '-----------------------------------------------------------------------------------
    Call Main()
    %>

  8. #8
    Join Date
    Jan 2003
    Location
    Dundee, Scotland
    Posts
    1,367
    hi,
    looking at your code i see you haven't got much of a form for taking the input for all your tables from the user. If you can build the form with all the textboxes/textareas that you need to insert into the database the we can help you with your insert statements. At the moment you have a form with only 1 textbox and 1 textarea for around 6 tables and 30 fields. So spend a few days preparing the form and i will help you process it.

  9. #9
    Join Date
    Dec 2002
    Posts
    316
    Hi [SWR]Ribeyed
    Thanks for attempting to help me with this.
    This is really appreciated.

    A few things to make you aware of.

    There are two forms. First called accidentReport.asp. This is carried over to the next form called propertyDamage.asp. The way the forms are designed is exactly the way the client wants it to look like.
    They want to be able to enter data on the first form and click continue and complete data entry on the next form before submitting.
    Once they hit the submit button, the other asp page that actually does the insert will be invoked.
    If you find it necessary to make any changes, please do so.

    I will probably post the forms seperately due to space limitations on the forum.
    Again, thanks a bunch.

    *******************
    This is accidentReport.asp
    ***************************

    <%@ Language=VBScript%>
    <%Option Explicit%>
    <%Response.buffer=true%>


    <HEAD>
    <LINK REL=STYLESHEET TYPE="text/css" HREF="af_styles.css">


    </HEAD>


    <CENTER>
    <BODY BGCOLOR="steelBLUE">
    <TABLE>
    <TR>
    <TD>
    <font class="ArialNarrow12" COLOR="khaki"><b>AccidentTracking - Co Vechicle/Accident Report</b></font>
    &nbsp;&nbsp;&nbsp;&nbsp;


    </TD>
    </TR>
    </TABLE>

    <FORM ACTION="propertyDamage.asp" METHOD="POST">
    <TABLE WIDTH=98% BORDER=0 BGCOLOR="khaki" CELLPADDING=4 CELLSPACING=0 >
    <TR>
    <TD ALIGN=CENTER VALIGN=TOP>
    <TABLE>
    <TD ALIGN=LEFT> <FONT CLASS='Arial10' ><B>
    Name Of Legal Owner
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="nameLegal" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    Name Of Driver<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="DriverName" VALUE="" >
    </TD>
    </TR>
    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    Age<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="Age" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    Department<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="dept" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    Work Phone Number<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="Work_Phone" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    Street Address<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="StreetAdd" VALUE="" >
    </TD>
    </TR>


    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    City<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="City" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    State<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="State" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Zip Code
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="ZipCode" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Second Street Address
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="ADDRESS2" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    City
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="CITY" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    State
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="STATE" VALUE="" >
    </TD>
    </TR>


    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Zip Code
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="ZIP_CODE" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Home Phone
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="HOME_PHONE" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Vehicle Year
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="vehicleYr" VALUE="" ></font>
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Vehicle Make
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="vehicleMake" VALUE="" ></font>
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Vehicle Type
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="vehicleModel" VALUE="" ></font>
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Licence Number
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="licenceNo" VALUE="" ></font>
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    County Vehicle Number
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="countyVehicleNo" VALUE="" ></font>
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Vehicle ID Number (VIN)
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="VIN" VALUE="" ></font>
    </TD>
    </TR>


    <TR>
    <TD>
    <B>Describe Damage To Car</B></FONT><BR>
    </TD>
    <TD>
    <TEXTAREA VALUE="" NAME="damageDesc" rows=6 cols=17></TextArea>

    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Estimate
    </TD>
    <TD><font color="RED">$:</font>
    <INPUT TYPE="TEXT" NAME="estimate" VALUE="" ></font>
    </TD>
    </TR>

    </TABLE>
    </TD>

    <TD VALIGN="CENTER" ALIGN=CENTER >

    <TABLE BORDER=1 CELLSPACING=0 CELLPADDING=4 BORDERCOLOR="khaki" >

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Date
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="Dt" VALUE="" ></font>
    </TD><TD><FONT CLASS='Arial10' ><B>
    Hour
    </TD>
    <TD>
    <INPUT TYPE="TEXT" SIZE="6" NAME="Hour" VALUE="" ></font>
    </TD>
    <TD>
    <INPUT NAME="AMPM" TYPE=radio VALUE="AM">AM
    <INPUT NAME="AMPM" TYPE=radio VALUE="PM">PM</FONT>
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Location
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="Loc_Desc" VALUE="" ></font>
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    On Which Side Of Street Were You?
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="SideOfStreet" VALUE="" ></font>
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Driving Which Way?
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="Driving" VALUE="" ></font>
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    How Far From Curb?
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="Curb" VALUE="" ></font>
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Were Lights On?
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="StreetLights" VALUE="" ></font>
    </TD>
    </TR>
    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Which Side Of Street?
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="StreetSide" VALUE="" ></font>
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Rate Of Speed?
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="RateOfSPeed" VALUE="" ></font>
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Direction Of Other Car?
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="carDirection" VALUE="" ></font>
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    How Far From Curb?
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="Curb" VALUE="" ></font>
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Were Lights On?
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="StreetLights" VALUE="" ></font>
    </TD>
    </TR>
    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Which Side Of Street?
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="StreetSide" VALUE="" ></font>
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Rate Of Speed?
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="RateOfSPeed" VALUE="" ></font>
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Weather Condition?
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="WeatherCond" VALUE="" ></font>
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Type And Condition Of Street
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="streetCondition" VALUE="" ></font>
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    What Warning Signals Were Given?
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="warningSignals" VALUE="" ></font>
    </TD>
    </TR>

    </TABLE>

    </TD>
    </TR>

    <tr>
    <td colspan=2 >
    <table border=5 width=100%>
    <tr>
    <td ALIGN=CENTER>

    <table border = 1 BORDERCOLOR=silver CELLSPACING=0 CELLPADDING=2>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Investigatin Officer
    </TD>
    <TD>
    <INPUT TYPE=TEXT NAME='officerName' VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Bage Number
    </TD>
    <TD>
    <INPUT TYPE=TEXT NAME='BadgeNo' VALUE="" >
    </TD>
    </TR>
    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Head Quarters
    </TD>
    <TD>
    <INPUT TYPE=TEXT NAME='headQuarter' VALUE="" >
    </TD>
    </TR>

    </table>
    </td>

    <td VALIGN=TOP >
    <table border = 0>
    <TR>
    <TD>
    <FONT CLASS='Arial10' ><B>
    Describe How Accident Occurred</b></FONT><br>

    <TEXTAREA VALUE="" NAME="acReport" rows=4 cols=25>&nbsp;</textarea>
    </TD>
    </TR>
    </table>

    </td>
    </tr>
    </table>

    </td>
    </tr>

    <TR>
    <TD bgcolor=khaki COLSPAN=2 BGCOLOR=WHITE ALIGN=CENTER>
    <INPUT CLASS="BtnFont" TYPE=SUBMIT VALUE="Conitnue>>" >
    </TD>
    </TR>

    </TABLE>
    </FORM>
    </CENTER>

    </BODY>

    The other page will be posted next.

  10. #10
    Join Date
    Dec 2002
    Posts
    316
    *****************************
    This is propertyDamage.asp
    *******************************

    <%@ Language=VBScript%>
    <%Option Explicit%>
    <%Response.buffer=true%>


    <HEAD>

    </HEAD>


    <CENTER>
    <BODY BGCOLOR="steelBLUE">
    <TABLE>
    <TR>
    <TD>
    <font class="ArialNarrow12" COLOR="khaki"><b>AccidentTracking - Property Damage Of Others/The Injured</b></font>
    </TD>
    </TR>
    </TABLE>

    <FORM ACTION="storeRec.asp" METHOD="POST">
    <TABLE WIDTH=98% BORDER=0 BGCOLOR="khaki" CELLPADDING=4 CELLSPACING=0 >
    <TR>
    <TD ALIGN=CENTER VALIGN=TOP>
    <TABLE>
    <TD ALIGN=LEFT> <FONT CLASS='Arial10' ><B>
    Name Of Legal Owner
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="nameLegal" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    Street Address<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="OwnerStreetAdd" VALUE="" >
    </TD>
    </TR>


    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    City<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="OwnerCity" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    State<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="OwnerState" VALUE="" >
    </TD>
    </TR>


    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Zip Code
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="OwnerZipCode" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    Home Phone Number<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="OwnerHome_Phone" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    Work Phone Number<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="OwnerWork_Phone" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    Name Of Driver<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="DriverName" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    Street Address<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="DriverStreetAdd" VALUE="" >
    </TD>
    </TR>


    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    City<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="DriverCity" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    State<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="DriverState" VALUE="" >
    </TD>
    </TR>


    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Zip Code
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="DriverZipCode" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    Home Phone Number<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="DriverHome_Phone" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    Work Phone Number<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="DriverWork_Phone" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    Driver's Lic No.<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="DriverLic" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    Year, Make, and Vehicle Type<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="vehicleType" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD>
    <B>Describe Damage To Car</B></FONT><BR>
    </TD>
    <TD>
    <TEXTAREA VALUE="" NAME="damageDesc" rows=6 cols=17></TextArea>

    </TD>
    </TR>


    </TABLE>
    </TD>

    <TD VALIGN="CENTER" ALIGN=CENTER >

    <TABLE BORDER=1 CELLSPACING=0 CELLPADDING=4 BORDERCOLOR="khaki" >

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Estimate Of Damage
    </TD>
    <TD><font color="RED">$:</font>
    <INPUT TYPE="TEXT" NAME="DamageEstimate" VALUE="" ></font>
    </TD>
    </TR> <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Insurance Company
    </TD>
    <TD><font color="RED">$:</font>
    <INPUT TYPE="TEXT" NAME="InsCo" VALUE="" ></font>
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Name of Insured
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="InsuredName" VALUE="" ></font>
    </TD>
    </TR>

    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    Street Address<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="DriverStreetAdd" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    City<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="DriverCity" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    State<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="DriverState" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Zip Code
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="DriverZipCode" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    Age<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" SIZE="3" NAME="InsuredAge" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    Injuries<B>
    </TD>
    <TD ALIGN=LEFT>
    <SELECT NAME="Injuries" SIZE="1">
    <OPTION value="-1" SELECTED>&lt;Choose One&gt;</OPTION>
    <OPTION value="Not Injured">Not Injured</OPTION>
    <OPTION value="Killed">Killed</OPTION>
    <OPTION value="Serious">Serious</OPTION>
    <OPTION value="Visible">Visible</OPTION>
    <OPTION value="Complaint">Complaint</OPTION>
    </SELECT>
    </TD>
    </TR>

    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Injuries Were Taken After Accident
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="accidentInjuries" VALUE="" ></font>
    </TD>
    </TR>

    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    Street Address<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="DriverStreetAdd" VALUE="" >
    </TD>
    </TR>


    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    City<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="DriverCity" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    State<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="DriverState" VALUE="" >
    </TD>
    </TR>


    <TR>
    <TD><FONT CLASS='Arial10' ><B>
    Zip Code
    </TD>
    <TD>
    <INPUT TYPE="TEXT" NAME="DriverZipCode" VALUE="" >
    </TD>
    </TR>

    <TR>
    <TD ALIGN=LEFT> <B><FONT CLASS='Arial10'>
    By Whom?<B>
    </TD>
    <TD ALIGN=LEFT>
    <INPUT TYPE="TEXT" NAME="ByWhom" VALUE="" >
    </TD>
    </TR>
    </TABLE>

    </TD>
    </TR>
    *********************
    I am splitting this page here. I will attach the other half.
    *************************

  11. #11
    Join Date
    Dec 2002
    Posts
    316
    my apology for all these codes.
    Here is a zipped file of the two pages.
    Attached Files Attached Files

  12. #12
    Join Date
    Jan 2003
    Location
    Dundee, Scotland
    Posts
    1,367
    hi,
    ok you say you have 2 pages but you posted code for propertyDamage.asp, accidentReport.asp and you provided a zip file with a page called accidentTrac.asp, which pages am i working with?

  13. #13
    Join Date
    Dec 2002
    Posts
    316
    sorry!
    I posted propertyDamage and when I attempted to post accidentReport page, I realized I was making the forum look vey untidy because the pages were long.
    So I zipped them up.
    If you don't mind, please ignore everything else I had posted and just grad the zipped file.
    It contains both pages.
    Thanks a lot for the help!

  14. #14
    Join Date
    Jan 2003
    Location
    Dundee, Scotland
    Posts
    1,367
    hi,
    thats no problem. What database are you using?

  15. #15
    Join Date
    Dec 2002
    Posts
    316
    hi!
    We have sql db but I would have no problems converting from access.
    Please whatever db you are comfortable with.
    thank you (can I just call you Ribeyed?)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles