N
n.repole
I've got a project I have to complete for my company, basically it's a
form that shoudl be able to load data from a database based on a
referenceID, and shoudl be able to submit data to a database, while
checking for duplicates. I've got a MS SQL database called
LegalRequest, and two tables within it: Requests and EventTracker.
Below is how my program should be laid out:
Connect to database
CmdLoadForm : OnClick (user puts in a referenceID and clicks button to
load info)
- if Requests contains input referenceID
- - Selects row which contains matching referenceID
- - Fills in a few fields
- - if EventTracker contains input referenceID
- - - Selects rows from EventTracker table with matching referenceID
- - - Iterates through selection
- - - - If 'Type' = one thing
- - - - - fill out these fields
- - - - end if
- - - - If Type = another thing
- - - - - insert another repeating section, and fill out those fields
(question here, if there are repeating sections, how do you choose say
the 2nd repitition of that section)
- - - - end if
- - - end iteration
- - end if
- end if
CmdSubmitForm : OnClick
- If referenceID already in Requests table
- - Update that row with data from form
- Else
- - Insert new row
- end if
- If docTrackingID already in EventTracking table
- - Update that row with data from form
- Else
- - Insert new row
- end if
Hopefully that's understandable. So basically what I need to do:
1. Connect to a database
2. load info from database into the form
3. submit info from form into database
So the issue's I'm having is I really don't know how to connect to the
database, how to check for certain things in the database, how to load
data from the database into a field on my form, and how to submit data
from my form to the database (though code). I'd prefer to do this all
in VBScript if possible, but if it's easier for someone to help me in
javascript thats fine as well. I'd really appreciate some help here...
form that shoudl be able to load data from a database based on a
referenceID, and shoudl be able to submit data to a database, while
checking for duplicates. I've got a MS SQL database called
LegalRequest, and two tables within it: Requests and EventTracker.
Below is how my program should be laid out:
Connect to database
CmdLoadForm : OnClick (user puts in a referenceID and clicks button to
load info)
- if Requests contains input referenceID
- - Selects row which contains matching referenceID
- - Fills in a few fields
- - if EventTracker contains input referenceID
- - - Selects rows from EventTracker table with matching referenceID
- - - Iterates through selection
- - - - If 'Type' = one thing
- - - - - fill out these fields
- - - - end if
- - - - If Type = another thing
- - - - - insert another repeating section, and fill out those fields
(question here, if there are repeating sections, how do you choose say
the 2nd repitition of that section)
- - - - end if
- - - end iteration
- - end if
- end if
CmdSubmitForm : OnClick
- If referenceID already in Requests table
- - Update that row with data from form
- Else
- - Insert new row
- end if
- If docTrackingID already in EventTracking table
- - Update that row with data from form
- Else
- - Insert new row
- end if
Hopefully that's understandable. So basically what I need to do:
1. Connect to a database
2. load info from database into the form
3. submit info from form into database
So the issue's I'm having is I really don't know how to connect to the
database, how to check for certain things in the database, how to load
data from the database into a field on my form, and how to submit data
from my form to the database (though code). I'd prefer to do this all
in VBScript if possible, but if it's easier for someone to help me in
javascript thats fine as well. I'd really appreciate some help here...