This topic is locked

Lookup wizard also displaying table from other db

1/15/2009 4:27:39 AM
ASPRunnerPro General questions
Z
zion4ever author

Hi there,
Can anyone plz help me out?

I would like (Asprunner 5.1) to have the lookup wizard on the Edit pages to also display a table that is on a different database server than the one the project works with. I would like this for my reservations system. This system keeps tracks of goods being rented and brought back. However I now have a text field with the name of the user (it is an intranet application) that has rented the stuff. Because the name needs to be typed in, it can cause typo's. I would prefer to have a dropdown list with all available usernames. However this list is available in the form of another table on a physical other database server. Is there any way to connect to this server (modifying the connectionstring in /includes/dbconnection.asp or edit sql manually? so that i can just select it from the lookup wizard and have it as a dropdown on my Edit pages. This dropdown should act as the textfield i have now would: save the value of the selected user from that dropdown to the regular database my project works with. In other words the dropdown should act the same as the text field with the only difference that it is populated from another table
Plz advise, i really need this feature.
Regards
Hans

Z
zion4ever author 1/15/2009

Anyone please?

J
Jane 1/15/2009

Hi,
to select values from another database edit BuildSelectControl function in the generated include/commonfucntions.asp file.

Open new connection, connect to the database and the close this new connection manually.

Z
zion4ever author 1/16/2009

Jane,
Thank you for your reply. I've looked at the function, but can't see how to implement the suggestion you made.

Can I just add a connection string in the buildselectcontrol function and create an sql query to lookup the table?

Would you plz be so kind to provide an example (including where to exactly put it in the function)
Thank you in advance

Z
zion4ever author 1/16/2009

Well,

I've managed to put in my connectionstring and it works. However in the BuildSelectControl function, under the comment Build control,

how would i make the function know that the recordset (Frs) data needs to go into the dropdown that asprunner builts ?
If i write my own loop:
Response.Write "<select name=user id=user><option value=Selecteren selected>Selecteren:</option>"

set Frs = my_conn.Execute(strSQL)

Do while Not Frs.EOF

if len(Frs("USER"))>0 then

Response.Write "<option title='" & Frs("PERSON") & "' value='" & Frs("USER") &"'>"& Frs("USER") &"</option>"

end if

Frs.MoveNext

Loop
Response.Write "</select>"

Response.Write "</form>"
Frs.close

my_conn.close
It creates a dropdown next to the dropdown that is built by asprunner.

But i want my records to go into the dropdown that aspr builts so that when I click SAVE on the edit page it saves the values as all other form elements

Z
zion4ever author 1/16/2009

If anyone has any clue please help me out?

Z
zion4ever author 1/16/2009

Never mind,
I fixed it. I only needed to add the recordset data to arr.d

Thnx again
Hans