Showing posts with label runtime. Show all posts
Showing posts with label runtime. Show all posts

Sunday, March 11, 2012

connecting to database in runtime using visual basic 6

hi;
i design a crystal report outside visual basic 6. what i did is just calling the crystal report filename. how can i change the source database of my crystal reports in runtime. im using microsoft sql server. the two database had the same table structure.
thanksWhich version of CR are you using?
If it is CR9 then
cr.Database.LogOnServer "p2ssql.dll", "Server", "Database", "UserName,"Password"

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 =)

Wednesday, March 7, 2012

Connecting to a different stored procedure at runtime

Hello..
I am using Crystal Reports 10. Am running the report through some asp pages. The report is tied to a stored procedure at design time. Can I make the report connect to a different stored procedure at runtime? Both these stored procs have the same output in terms of columns. They differ only in the data.
Thanks,
ManishTry this
In your Application Use

CR.Database.tables(0)="SP Name"