Microsoft SQL Server
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMicrosoft SQL Server

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 19th, 2004, 04:05 AM
benns benns is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 2 benns User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question How to change DB connection at runtime for CR using VB

Hi,

i have 2 MSSQL DBs.
im using DSN name to connect MSSQL DB to generate the report. for example, i have designed a report CR1 from the DB using dsn, named DSN1 which refers
the DB named Master1.

but now i want to connect the same report CR1 in a another dsn name called as
DSN2 which refers MSSQL DB named as Master2.
(because the both DB's have the same table, but i want the report to print from another DB's table. )

but at runtime if i do the coding from vb application like,

crystalreport1.connect = "DSN=DSN1"

(this coding works if the dsn name as DSN1)

its giving error msg like "error detected by database dll".

How could i make the data connectivity at runtime to point the different dsn name ie, DSN2. (consider i design the report manually at design mode of CR and connect the DB thru DSN ie, DSN1 refers Master1 DB and call it in vb application at runtime.)

Reply With Quote
  #2  
Old October 13th, 2004, 03:47 AM
tommygun tommygun is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2004
Posts: 2 tommygun User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
You can change the database connection to another SQL server database by changing the connection string for the 'current project'. Look for the exact syntax on msdn.

following link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdprostatex.asp See the string 'strCnxn' for the correct syntax.



Quote:
Originally Posted by benns
Hi,

i have 2 MSSQL DBs.
im using DSN name to connect MSSQL DB to generate the report. for example, i have designed a report CR1 from the DB using dsn, named DSN1 which refers
the DB named Master1.

but now i want to connect the same report CR1 in a another dsn name called as
DSN2 which refers MSSQL DB named as Master2.
(because the both DB's have the same table, but i want the report to print from another DB's table. )

but at runtime if i do the coding from vb application like,

crystalreport1.connect = "DSN=DSN1"

(this coding works if the dsn name as DSN1)

its giving error msg like "error detected by database dll".

How could i make the data connectivity at runtime to point the different dsn name ie, DSN2. (consider i design the report manually at design mode of CR and connect the DB thru DSN ie, DSN1 refers Master1 DB and call it in vb application at runtime.)

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMicrosoft SQL Server > How to change DB connection at runtime for CR using VB


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT