I'm is new member, I have trouble with my application. I'm use visual basic 6.0 with access as database and crystal report 8.5. My trouble is "Run time error 20507 Invalid file name. I have script like this :
CR.DataFiles(0) = App.Path & "\databasename.mdb"
CR.ReportFileName = App.Path & "\reportfilename.rpt"
CR.WindowState = crptMaximized
CR.Action = 1
When the click button for view report, show message error as above.
Somebody help me.....
I'm very thank's
first of all, if you're working with vb6 have you ever heard of debugging ?
have you checked whether App.Path is with or without "\" ?
Sometimes with App.Path it's not necessary to add a Backslash if the Application is in Root Directory
for example "C:\" - you see ?
On which line do you get the Error ?
Database or CR-File ?
Edited by: Thomas Br on Nov 1, 2011 9:33 PM
You're asking a Crystal Reports OCX SDK question. You should post your question to the [Legacy SDKs - SAP Crystal Reports|SAP Crystal Reports - Legacy SDKs; forum and close this thread.
The old OCX (crystl32.ocx) error messages were usually pretty accurate. Invalid file name typically means that the path and name of the report were entered incorrectly in the ReportFileName property. Make sure that the path and name of the report are correct and that there are no trailing spaces in the string.