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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing from one DSN to Another (ODBC)

Status
Not open for further replies.

herci

Programmer
Nov 8, 2002
23
PA

Hi..
I am running some reports from an application in Visual Basic 6.0 using an ODBC connection to a SQL server database.. I have created two DSN with the same user id and password for both to access as a SQL client.. My app was pointed one of them... but I need to have my app reports pointing to the other dsn.. I am trying to change the location from Crystal Report but it's still recognizing the first dsn as the current database, even I have logged and pointed the second DSN, in the SET LOCATION option...

The information that appears below the SET LOCATION option
is:
SERVER TYPE : ODBC - ppccasi
SERVER Name= ppccasi
Database: ppcasig
USER ID: asignacion

I don't know how to change the Database from ppcasig to ppccasi... in order to show the reports with the data from the ppccasi database


I will appreciate any kind of help

thanks








 
>I need to have my app reports pointing to the other dsn

I know there are differences for an ODBC connection, but maybe this will point you in the right direction; here is how I'm doing it for an OLE DB (ADO) connection in ASP...
Code:
   For Each Table In Session("oRpt").Database.Tables
      Table.SetLogonInfo CStr(s_Server), CStr(s_Database), CStr(Session("request_form_login")), CStr(Session("request_form_password"))
   Next
By the way, s_Server and s_Database are variables defined elsewhere, and request_form_login and request_form_password are Session Variables. Hope this helps.
Good Luck! [thumbsup2]
WindUp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top