Hello all,
I have a question. I have a list page that lists network configuration info. One field is called "Hostname". This field holds the name of a domaincomputer, e.g. "Client225".
The info is loaded from the database correctly. However, I have added a column in front of the EDIT and SHOW links on the listpage. This Column has the header "SHOW STATUS". I want this column to response.write a status check from another database on another server.
I have experimented with adding a custom snippet of asp code in the visual editor on the list page:
Set my_conn = createobject("ADODB.Connection")
myconn.open = "DRIVER={MySQL ODBC 5.1 Driver};"
& "SERVER=SecondDBServer;"
& "DATABASE=AnotherTable;"
& "UID=MyUser;PWD=MyPassword; OPTION=35;"
DBstrSQL="select DISTINCT h.status from HOSTS_INTERFACES
as h WHERE h.NAME='" & SelectedHost & "';"
set Frs = my_conn.Execute(DBstrSQL)
Do while Not Frs.EOF
Response.write Frs("Status")
Frs.MoveNext
Loop
Next
The problem is that I do not know what to fill in for the variable SelectedHost. This should be a string equalling the Hostname that is retrieved from the first db and that is shown on the listpage. I'm not sure how i can get a handle to the hostname for that new row, which clearly changes each time a record is retrieved from db and displayed by aspr 6.1
I also tried using data("Hostname") under LISTPAGE: Before record processed and storing it in a session variable, delimited by a comma. I then tried parsing each entry in the array (using Split) from the custom asp snippet on the listpage, but no luck. There must be a better way.
Thank you in advance
Hans