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