Thursday, March 8, 2012

Connecting to Access2000 database at runtime from VB

Hi,

I want to connect to Crystal reports from VB.I am using CR ver 8.5 The database should be set at runtime instead of design time so that where ever I place my application the report should work from that directory (it could be d:\ or e:\ or N:\). The path should not be hardcoded in the report where we give the set location path. plssss help me out, this is very urgent

venkyHi Venky,
See if this will help:
http://www.dev-archive.com/forum/showthread.php?t=337289|||strDBPath = App.Path & "\CTS.mdb"
Set conRep = conAPP.OpenReport(App.Path & "\reports\PCCost.rpt", 1)
Set crxDatafiles = conRep.Database.Tables
crxDatafiles(1).SetLogOnInfo (strDBPath)

but still i am getting the error "File could not be found" "PCMonAmtQ" at file location "CTS.mdb"

pls let me know what is the error

thanks in advance

venky|||Hmmmm, that's a strange error message. It seems like it is looking for a file called "PCMonAmtQ". Could that be associated with your db?

I wish I could be of more help, but I am at a lose here...

Keep me posted =)

No comments:

Post a Comment