Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Please Help - Connect Reports with Multiple ODBC from ASP

Status
Not open for further replies.

zwieback89

Programmer
Mar 8, 2001
42
US
Hi,

I have a successfully been able to access a report developed in 8.5 which when designed was connected to one ODBC name (ODBC_1). I do not get any errors now. Except for the table name, I stripped off the databasename.dbo before the table name. I am able to see the results of the report. I pass a Patient ID and am able to see the report in
the browser window.

My question now is as follows:

From my ASP page, I pass a parameter to the SetlongonInfo method in
the following way:

stAlias catches the database name passed from the previous ASP page.

if stAlias = "Database1" then
stODBC = "odbc1"
stDatabase = "Database1"
elseif stAlias = "Database2" then
stODBC = "odbc2"
stDatabase = "Database2"
end if

(I created 2 System ODBCs in the web server - one pointing to Server1 and Database1; and the second one pointing to Server2 and Database2) Both of the UserID of 'sa' and password of ""

userid = "sa"
password = ""
crtable.SetLogonInfo cstr(stODBC), cstr(stDatabase), cstr(userid), cstr(password)

Even though there are two different databases (databases with different names), the tables, their field names and the views are the same. Basically both the database have different data.

But when I designed the report, it was created off odbc1. So from the web page, when I say show me records of a patient from the 2nd ODBC (ODBC2 which points to Database2), then I go not get to see any records in the report. I guessed that this is because I created the
report off the ODBC1.

How can I pass the ODBC and the database name as well so that I get to see the same report reflecting different data from two different databases.

What is it that I must do in the CR to strip off the ODBC name ? (Infact when I open the Set Location under the Database menu, I see the table name in the text box. Also I see in the area below the text box which gives information:

ServerName - ODBC1
DatabaseName - Name of the ODBC.
UserID - sa

Hope that I was clear in my explanation.

Regards, Padmaja.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top