|
|
| Author |
Message |
Belal User

Joined: 08 Mar 2004 Posts: 84
Location: Dhaka, Bangladesh
|
Post subject: How to connect with Crystal Report 9 from Visual Basic 6 |
|
|
Hello,
I need to know how can I connect with a report created by Crystal Report 9 from my vb6 application. The report is using OLE DB connection to connect with it's database and the database is passward connected. So, I also need to know how can I call this report providing database path, password etc. at runtime. i.e when the report will be clicked to open, it will connect to the database and show the up-to-date data.
Quick help is required.
belal _________________ we've lot of things to think abt curr probs
so, i don't have time to think abt religion or wonder of sceice .......... how ppl can waste their time like this? |
|
Fri Aug 20, 04 11:30 am
 |
|
 |
dinangkur Super Moderator


Joined: 24 Mar 2004 Posts: 491
Location: Dhaka, Bangladesh
|
Post subject: |
|
|
I just found a solution. I hope this will help. Do the following when you create report.
1. When you start crystal report.
2. From Menu->Database->Log on/off server
3. Click on more data source
4. Select OLE DB
5. Double Click on Make new Connection.
6. Select OLE DB provider from the menu(for your access database seletct jet OLE DB 3.51 or 4.0
7. Click Next
8. Select the database
9. If you want to give database password turn off blank password option and type your password
10. Click on "Test connection" at the bottom
11. If connection is succeed then delete all the location address of the database from "select or enter database name", just leave the database name there. Again, click on "Test connection". You will find it's working.
Then create your record and later add it to your VB6.
Have fun.
-DK. _________________ ...we too are stardust... |
|
Fri Aug 27, 04 9:55 pm
 |
|
 |
Belal User

Joined: 08 Mar 2004 Posts: 84
Location: Dhaka, Bangladesh
|
Post subject: |
|
|
Thanks Dk, for your reply.
I've tried with your solution. But I didn't find "Test Connection" option. Which crystal report version you are using really. I like to get a solution that works fine with crsytal report 9.
Hope you try again and give a helpful solution. _________________ we've lot of things to think abt curr probs
so, i don't have time to think abt religion or wonder of sceice .......... how ppl can waste their time like this? |
|
Sat Aug 28, 04 4:53 am
 |
|
 |
hasnut Expert User


Joined: 28 Aug 2004 Posts: 201
|
|
Sat Aug 28, 04 6:08 pm
 |
|
 |
dinangkur Super Moderator


Joined: 24 Mar 2004 Posts: 491
Location: Dhaka, Bangladesh
|
Post subject: |
|
|
The solution I posted that was for crystal report 8.5. Sorry for that. For 9.0 I will post later today. By the way, Mr. Sardar your CY link is not working. Will you please, repost it again. Thanks.
-DK. _________________ ...we too are stardust... |
|
Sat Aug 28, 04 9:10 pm
 |
|
 |
dinangkur Super Moderator


Joined: 24 Mar 2004 Posts: 491
Location: Dhaka, Bangladesh
|
Post subject: |
|
|
Belal,
It's quite interesting topic. Last night I checked in Crystal Report 9. A lot of changes in there. So, it tooks a bit time to digest that much things within a hour. Interesting thing is that Crystal Report 9 introduced a new built-in custom module as like Microsoft's data link file. Though that function is not capable to use path independent ADO DB data access from Access database. So, that's why they still offer at the bottom of that page to use Microsoft data link file. So, I used my own .udl file to track the access database as path independent, it works fine. Funny thing is that if tried to modified or open the log on/off server option. It's just change the path independent information with path-information which later make problem while using it from VB6. You can avoid it by ignoring it or don't try to reconfigure database connection. There is another reason for that Crystal report 9 introduced .NET facalities and Microsoft is shiping Crystal Report with .NET. So, if you program with .NET and use crystal report 9 then it's work fine. If you use VB6 then better use crystal report 8.5. By the way, following I did after you request and it's working fine on my "test" project.
I build a custom test.udl in the same folder where VB6 project and Access *.mdb file is. After that I connect the database with test.udl.
1. Choose Jet 4.0 OLE DB provider
2. Select the database
3. If you database is locked with password then click on "All" tab and then click on "JET OLEDB:Database Password"
4.Put your password in the popup input box.
5. Test connection
6. Now you take out the path from the database location field.
7. Test again. If test connection is ok, then press ok and get out.
8. Now open crystal report 9, from ADO DB make new connection-you will see at the bottom of that window (if you want to use microsoft data link file), cilck on the option button and it will offer you to browse, you choose the test.udl file which you just make. Then click finish. Now your report is path independent. Create report.
9. After that open VB project and add crystal report 9 and add that existing report and run it, hola.
10. Do not delete or relocate the *.mdb, test.udl or *.rpt until you make final package. If you need futher assistance let me know.
-DK. _________________ ...we too are stardust... |
|
Sun Aug 29, 04 12:44 am
 |
|
 |
Belal User

Joined: 08 Mar 2004 Posts: 84
Location: Dhaka, Bangladesh
|
Post subject: |
|
|
Thanks DK, For Your Time and Effort To Solve My Problem.
It's now working fine.
To me Crystal Report 9 connection from visula basic 6 (vb6) is solved.
This time I feel no problem to open my report (created by crystal report 9) with updated data.
Thanks Again Dk, I am in joy
belal
-----Mr. Sarder Hasnut, Dk is right. Your specified link can't be found. Would you clear your link again or little description about the solution type if it maches with this thread. Thanks for your post. _________________ we've lot of things to think abt curr probs
so, i don't have time to think abt religion or wonder of sceice .......... how ppl can waste their time like this? |
|
Sun Aug 29, 04 2:29 am
 |
|
 |
dinangkur Super Moderator


Joined: 24 Mar 2004 Posts: 491
Location: Dhaka, Bangladesh
|
Post subject: |
|
|
Thanks God. I can sleep tonight. :)
-DK. _________________ ...we too are stardust... |
|
Sun Aug 29, 04 2:55 am
 |
|
 |
hasnut Expert User


Joined: 28 Aug 2004 Posts: 201
|
Post subject: |
|
|
PRoblem with the forum it makes a gap(blank space) with the link
click reply and see in topic review then you will get the orginal link.
the last filename will be samplescr.asp no blank space after sample. _________________ Sarder Hasnut
MCSD, CIW A
Need Low Cost Prefessional Hosting Contact me |
|
Sun Aug 29, 04 3:24 am
 |
|
 |
quantum Site Admin


Joined: 07 Mar 2004 Posts: 1048
Location: Dhaka, Bangladesh
|
Post subject: Long strings |
|
|
| hasnut wrote: |
PRoblem with the forum it makes a gap(blank space) with the link
click reply and see in topic review then you will get the orginal link.
the last filename will be samplescr.asp no blank space after sample. |
I am aware of the problem. Actually this happens with long strings. I was doing some fiddling with the wordwrap to fix something else. The gap will still appear if the string is more than 80 characters(previously 50). If I can find a solution to the other problem then I can get rid of the wordwrap. In the mean time please look in the long urls for any blank space and delete it from the browser address bar. IE sometimes automatically converts blank space to %20 so look for %20 too to in the copied addres and delete it. Another solution is to use the URL BBcode and use a short title for anchor text when you are posting a long url. _________________
Dust fills my eyes / Clouds roll by / and I roll with them / Centuries cry / Orders fly / and I fall again
Afford best design, implement best solution. Outsource your web design.
|
|
Sun Aug 29, 04 4:02 am
 |
|
 |
hasnut Expert User


Joined: 28 Aug 2004 Posts: 201
|
|
Sun Aug 29, 04 4:36 am
 |
|
 |
quantum Site Admin


Joined: 07 Mar 2004 Posts: 1048
Location: Dhaka, Bangladesh
|
Post subject: |
|
|
The original phpbb was okay. But as you can see this forum has been modified heavily. I made a whole bunch of changes. Every major php file was modified. not to mention the template. One of them forced me to use a wordwrap in the vewtopic array. There sh'd be a way around this. I will look into it soon. For now please use the URL bbcode. _________________
Dust fills my eyes / Clouds roll by / and I roll with them / Centuries cry / Orders fly / and I fall again
Afford best design, implement best solution. Outsource your web design.
|
|
Sun Aug 29, 04 4:42 am
 |
|
 |
|