Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble opening a report 1

Status
Not open for further replies.

Dominator22m

Programmer
Oct 15, 2003
10
GB
Hi developers,

Please could anyone help me with the following problem, i have been stuck on this now for about a week and time really is of the essence.

I have a large project which uses many different reports, and on a couple of the reports, when i try to open it through visual basic i get the following error:

[Microsoft][ODBC Driver Manager] Data source name too long

I am using the driver pdsmon.dll in crystal. I am also opening a recordset and passing it to the report.

This error doesnt happen all the time, only sometimes which puzzles me even more. It errors on the following file :-

c:\program files\gprs\company.mdb

I cant shorten this path anymore. I am using vb6 and crystal reports 8.5

Any help or guidance anyone could give me on this matter would be greatly appreciated as the software is due to be launched.

Thanks in advance

Brian


Bad spellers of the world untie!!!
 
This message doesn't really make sense for the approach you're taking (i.e., pdsmon.dll). Of course, illogical error messages aren't uncommon. If you're using pdsmon.dll, your report shouldn't be looking for company.mdb, at least not if you're passing the recordset prior to displaying the report. Can you please post code that shows your creation of the report object and how you are passing it the recordset and calling for the viewer. Also, how did you initially design the report? Was company.mdb ever a part of the design process? And are there any subreports in the report? Lastly, what line of code actually generates the error you mentioned?
 
Thanx for the reply. Ahhh your reply has helped. Thinking about it, there are two databases in the report both of which have been part of the design process. I have just relised that i dont pass any recordset for the company database as there is always only 1 record. Maybe this could be the problem ? This is the code :-

I have not included all the connection code

With RsHistory
.Open &quot;SELECT * FROM history WHERE [gprs date] >= #&quot; & Format(StartDate, &quot;mm/dd/yyyy&quot;) & &quot;# AND [gprs date] <= #&quot; & Format(EndDate, &quot;mm/dd/yyyy&quot;) & &quot;#&quot; & Sql & &quot;)&quot;, ConHistory, adOpenStatic

End With

Screen.MousePointer = vbHourglass
Report.DiscardSavedData
Report.Database.SetDataSource RsHistory, 3, 1
Set SubReport = Report.Subreport1
SubReport.OpenSubreport.Database.SetDataSource RsHistory, 3, 1

CRViewer1.ReportSource = Report

CRViewer1.ViewReport 'This line errors

Once i get the error and then try to open the dsr in visual basic i get the same error and datasource is highlighted

I hope i have gave you enough information here to help me further

Thanks Very Much

Brian




Bad spellers of the world untie!!!
 
Please disregard the previous post.

Thank you very much *FVTrainer* your post got me going in the right direction. The problem was that i wasnt actually passing the recordset for the company database. I cant began to tell you how much time and effort (and ear ache) you have saved me.

Thanx Again

Brian


Bad spellers of the world untie!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top