Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Populate Cristal Report without DSN

Posted on 2002-06-18
9
Medium Priority
?
196 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_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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
 

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 1200 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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
Suggested Courses

722 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