Solved

Populate Cristal Report without DSN

Posted on 2002-06-18
9
178 Views
Last Modified: 2010-05-02
Hi

I have made an application in Visual Basic that connects to SQL-Server without using a DSN. (just a simple connectionstring)

Now, if I want to make a Cristal Report it looks like I need to make a DSN.

Is there any way to work around this problem?  

Thans a lot!

Rosie
0
Comment
Question by:Rosi_
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 3

Expert Comment

by:Elmo_
ID: 7089501
Rosie,

Are you Using the Crystal Reports Control(crystl32.ocx)?

Could you post the Connect String that you are using so I could Have a look at it?

Cheers,

Ed.
0
 
LVL 18

Expert Comment

by:bobbit31
ID: 7090267
if you want to set your connection string when you make a new report... when you select your database use these options:

more datasources/active data/active data (ADO)

select the ado and oleDB radio button
then put your connection string in the textbox
0
 
LVL 1

Expert Comment

by:Chess
ID: 7090844
You can use a DSN less connection, just like you already have connecting to SQL-server.  Use the same connection string.  Add code similar to this:
-------------------------------------
sreport_name = "rpt_swap_valuation.rpt"
   
   sreport_name = App.Path & "\REPORTS\" & sreport_name
   
   Set crreport = crapplication.OpenReport(sreport_name)
   For i = 1 To crreport.Database.Tables.Count
       crreport.Database.Tables(1).SetLogOnInfo gServerName, gDbName, gLogin, gPassword
       crreport.Database.Tables(1).Location = gDbName & ".dbo." & "Get_Swap_Appraisal"
   Next i
   crreport.ParameterFields(1).AddCurrentValue (sreport_fund_num)
   crreport.ParameterFields(2).AddCurrentValue (CDate(sreport_processingdate))
   crreport.ParameterFields(3).AddCurrentValue (gFundgroupnumber)
   frmReport.rptViewer.ReportSource = crreport

   frmReport.rptViewer.ViewReport
   frmReport.Show
0
 

Author Comment

by:Rosi_
ID: 7091931
My first answer is for Elmo:
I haven no idea wich one... sorry
My connectionstring:
strSecConn = "Provider=SQLOLEDB.1;Integrated        
    Security=SSPI;Persist Security Info=False;" & _
    "Initial Catalog=" & strSecDatabank & ";Data Source="
    & strSecServer
where I fill the variables with values I read from an Ini-file.

To bobbit31:
I cannot find the options you specified ... sorry
I can tell you I have productn° 4.6.1.0 and CRW32 4.6.1.116.  Maybe an old version?

To Chess:
thanks, I'll try it right away!

0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 

Author Comment

by:Rosi_
ID: 7091951
Chess, I'm gonna need some more help.
Cause, if I open the Crystal Reports then I can only choose to create a new report before doing anything else.
Also: where do I put the code?
0
 
LVL 1

Expert Comment

by:Chess
ID: 7092510
You can pass in the name of an existing report. In the code that I have posted above, "rpt_swap_valuation.rpt" is the name of the report.  It is using a stored procedure called "Get_Swap_Appraisal".

If you need to open the report based on some user action such as clicking a command button, then put the code in the click event of the command button.  

If you still need more clarification, please post your code in full.
0
 
LVL 18

Accepted Solution

by:
bobbit31 earned 300 total points
ID: 7092666
ahh... you are using an old version of crystal reports.
I use crystal 8.0, so that's probably why you don't see the same options.  I don't know how to do it (or even if you can) in cr 4.6
0
 

Author Comment

by:Rosi_
ID: 7095975
Well, first I'm going to try the get my hands on that latest version!

I won't forget you guys to make one of you happy with my 300 points!
0
 

Author Comment

by:Rosi_
ID: 7126469
Problem solved by using a newer version of Crystal Reports, so the points go to..... Bobbit31
Thanks a lot for all the help!
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now