- Vb6 and ms access - print with crystal report 8.5, you can download the source code here download crystal report he.
- Create a NEW Standard Exe in VB (I use VB6) 2. Click Project, click References and select: (I use Crystal 9) Crystal Report Viewer Control 9 --- Crystal Reports 9 ActiveX Designer Design and Runtime Library.
- 'There is no need to write here my code that is in vb6 and uses crystal report 9 by giving statement of appl path. This application that opens a recordset and then prints it, runs fine on the original PC where there is VB 6 and crystal reports are Installed. You need to use the ODBC Data Source Administrator tool to add DSN on the second.
After you run the source code you will get the report like this. Hope this tutorial help you to create your first Crystal Reports. Sample Database and tables for Crystal Reports tutorials. How to load crystal Report in my Visual Basic Apllication? I wish to call crystal report in my VB6 Application. For showing data report i used following code..EnableExportButton = True 'Disables the CRViewer's Search control CRViewer.EnableSearchControl = True 'Set the report source CRViewer.ReportSource = crxReport 'View the report. Hi, plesae i wanna know how can i change my source (to my database) connection to my crystal report in vb, not in crystal report; with oledb;i don't want to make a connection to my database from crystal but from vb because i have many database and i want to connect to them from vb dynamiclly and thank you a lot.
Active4 years, 1 month ago
When creating my Crystal Report I obviously set up a database and server connection that I use for development.
What I want to do now in my VB application is to dynamically set the database and server name to use with the reports. I have these values as the strings varServer and varDatabase.
Anyone know how to go about doing this?
Thanks in advance.
P.S I have tried several online solutions but am having trouble with VB6.
Andrei49.4k77 gold badges7373 silver badges9898 bronze badges
Den
4 Answers
This link has all information you want to know.
UPDATE: Here is a minimum working sample for integrated authentication with SQL Server. You should use the ConnectionProperties of the table object to set connection parameters.
GSerg63k1515 gold badges115115 silver badges249249 bronze badges
MicSimMicSim20.7k1414 gold badges7676 silver badges120120 bronze badges
Great Work! thanks For the code! I change it a bit though because this part was not working:
It had an error that could not find object
So I did it like that:
shA.t13.5k44 gold badges3939 silver badges7777 bronze badges
TasosTasos
What version of crystal are you using?
In the .net world, I generally pass the dataset to the report as emoreau says here.
That way, your connection is set from code rather than crystal and can be stored in a global connection property. However, that's .net. I'm thinking that either the version of crystal you have should have similar functionality OR Emoreau may have an example of how to do it in VB6 in the version you're using.
Hope that get's you started.
Bill MartinBill Martin
Crystal Report 9 For Vb6 Source 1
3,10688 gold badges4545 silver badges8383 bronze badges
One can also set the default provider for the report by adding this code bit.
KenDogKenDog