Data Connectivity
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Data Connectivity
Message Icon Topic: How to change database location from application Post Reply Post New Topic
Author Message
jineshtr
Newbie
Newbie


Joined: 04 Jan 2009
Location: India
Online Status: Offline
Posts: 5
Quote jineshtr Replybullet Topic: How to change database location from application
    Posted: 20 Jan 2009 at 4:36am
We are using VB 6 as front end and MS Acsess as back end. V have 5 company's databases which are kept in separate folders and same application will access different databases as per company selection in the time of login to the application by the user.
Databases are kept like
\\server\Data\001\SmartPOS.mdb
 
If someone select 1st company then reports also should point to that database \\server\Data\001\SmartPOS.mdb, if 2nd then\\server\Data\002\SmartPOS.mdb So I want to change database location from application in the time of calling the rpt file. I could do this by creating separate DSNs for all the databases in all the client PCs like 001- for 1st company,002- 2nd company etc. and save that DSN name in company master table in each database. and use that DSN to connect database in the time of calling the report with the command
crpt.Connect = DSN=" & GlbDSNName & ";UID;PWD;". This is works fine. But problem is, if there are 30 clients, I have to create 5 DSNs in each PCs (30*5). If we add one more company, again have to create another DSN for that company in each PC. So is there any other way to connect report by giving full database path without using DSN like
Driver={Microsoft Access Driver (*.mdb)};  Dbq=" & DataPath & "\SmartPOS.mdb;Uid=;Pwd=;" 
 
I think, you could understand my practical issue.. so please help me..
 
Jinesh


Edited by jineshtr - 20 Jan 2009 at 4:37am
IP IP Logged
BrianBischof
Admin Group
Admin Group
Avatar

Joined: 09 Nov 2006
Online Status: Offline
Posts: 2458
Quote BrianBischof Replybullet Posted: 20 Jan 2009 at 10:29am
It's been a long time since I used VB 6, but you can use a DSN-Less connection in .NET and I'm certain you could do it in VB 6 also.

From Google, I found this link as well:
http://visualstudiomagazine.com/features/article.aspx?editorialsid=1758
Please support the forum! Tell others by linking to it on your blog or website:<a href="http://www.crystalreportsbook.com/forum/">Crystal Reports Forum</a>
IP IP Logged
jineshtr
Newbie
Newbie


Joined: 04 Jan 2009
Location: India
Online Status: Offline
Posts: 5
Quote jineshtr Replybullet Posted: 20 Jan 2009 at 9:13pm
Thanks for your reply, VB application can connect Access database in this way. But I want change the database location for crystal report file in the run time.
 
Jinesh
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.027 seconds.