This topic is locked

Linking tables

12/11/2006 12:24:54 PM
ASPRunnerPro General questions
D
dunga author

hi,

I have 2 tables

  1. orientation
  2. nursing attendance
    table orientation and nursing attendance share

    same 3 fields:
    EmployeeId

    Name

    Manager
    I am quite new to databases(sorry if it may dissappoint some of us)

    I am trying to accomplish the follwing:
  3. build an ASP Runned webaccessed pages for both tables: (no problems so far with this part)

    to view, edit or to work with these tables individually
  4. make sure that values in the "nursing attendance" in the Linked fields

    EmployeeId

    Name

    Manager
    are automatically populated "from the orientation" table upon login...
    is that at all possible, if yes please let me know how.
    I will greatly appreciate it.
    thanks

J
Jane 12/12/2006

Hi,
you can do it using BeforeLogin event.

Here is a sample code:

Function BeforeLogin(username, password)

str = "select * from orientation where UserName='"&username&"'"

Set rsTemp = server.CreateObject("ADODB.Recordset")

rsTemp.open str, dbConnection
strSQLInsert = "insert into [nursing attendance](EmployeeId, Name, Manager) values ("& rsTemp("EmployeeId") & ",'" & rsTemp("Name") & "','" & rsTemp("Manager") & "')"

dbConnection.Execute strSQLInsert
BeforeLogin = True
End Function



where UserName is your actual field name where login name is stored.

D
dunga author 4/14/2008

hi, Jane

i did not want to star new thread on almost similar issue.
let's say i have 3 databases(databases)

where all tables and fields are named and structured exactly the same.
i explain:
these are course databases populated when a user answers questions.

the primary key column everywhere is ID(which is autonumber)

however every database have an employeeId field wichiis numeric.
what I would like to accomplish is to somehow LINK all these databases via creating an application through ASP runner.

is it possible?
so the ultimate goal is:

  1. user logs in
  2. and sees all his courses with details of the results
    or/and manager logs in and via search can see all data related to that search criteria.
    can this be done?

    if yes please guide me.

    thank you.