•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Visual Basic 4 / 5 / 6 section within the Software Development category of DaniWeb, a massive community of 456,497 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,737 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 2316 | Replies: 12
![]() |
•
•
Join Date: Sep 2007
Posts: 50
Reputation:
Rep Power: 2
Solved Threads: 0
Sir, I have prepared programme using VB6 and Access2003. The programme is working very fine so far as adding,deleting,modifying the record through VB is concerned. I have installed Crystal Report 8.5 and have prepared a report and save as (bill.rpt) but I dont know how to connect the report with VB. The path of report is C:\ks\bill.rpt and path of database in Access is C:\ks\exp.mdb
I shall be grateful if you kindly help me
1. to connect the report with VB and
2. to pass a query in which if I enter America in Text1.text in VB and Click the command button VIEW the report should generate only the name and age of all the person who live in America within the field (address).
The Data base fieldname are Name, age and address
I am very new to CR so pl write all the code to write within the click event procedure of command button VIEW so that I may not add anything else.
thanking you in anticipation
Keshar
I shall be grateful if you kindly help me
1. to connect the report with VB and
2. to pass a query in which if I enter America in Text1.text in VB and Click the command button VIEW the report should generate only the name and age of all the person who live in America within the field (address).
The Data base fieldname are Name, age and address
I am very new to CR so pl write all the code to write within the click event procedure of command button VIEW so that I may not add anything else.
thanking you in anticipation
Keshar
you have to create an ODBC connection with the access database to connect your program to the crystal report. then create an query and make the report based on that query. after that you will call the query in your program and the rest will be handled by ur apps.
first of all u have to create an query in ur access db. then...
if u r not familiar with how to create an access odbc connection plz follow the steps:-
1.goto control panel->administrative tools->database(odbc connection)
2.in user dsn tab select add
3.select microsoft access driver .mdb from list and click finish
4.enter ur dsn name(this can be anything)
5.click select and locate ur access db
6.click ok
7.then ok again to create the dsn
after creating it goto crystal report and select the dsn under the odbc section from the connection tree while u select to create a new blank report.
use the query what u created in ur db to fetch the fields from it into the report. create the report based on that query.
after this use the following code to create the query dynamically to run it from ur vb6 apps:-
Dim db As Database
Dim qdf As QueryDef
Set db = CurrentDb()
Set qdf = db.CreateQueryDef("MyQuery", "SELECT * FROM MyTable")
Set db = Nothing
then use a crystal report control and pass ur dbname,query and report name as parameters. ur program now should call the report.
hope it'll work.
regards
Shouvik
first of all u have to create an query in ur access db. then...
if u r not familiar with how to create an access odbc connection plz follow the steps:-
1.goto control panel->administrative tools->database(odbc connection)
2.in user dsn tab select add
3.select microsoft access driver .mdb from list and click finish
4.enter ur dsn name(this can be anything)
5.click select and locate ur access db
6.click ok
7.then ok again to create the dsn
after creating it goto crystal report and select the dsn under the odbc section from the connection tree while u select to create a new blank report.
use the query what u created in ur db to fetch the fields from it into the report. create the report based on that query.
after this use the following code to create the query dynamically to run it from ur vb6 apps:-
Dim db As Database
Dim qdf As QueryDef
Set db = CurrentDb()
Set qdf = db.CreateQueryDef("MyQuery", "SELECT * FROM MyTable")
Set db = Nothing
then use a crystal report control and pass ur dbname,query and report name as parameters. ur program now should call the report.
hope it'll work.
regards
Shouvik
•
•
Join Date: Sep 2007
Posts: 50
Reputation:
Rep Power: 2
Solved Threads: 0
Sir,
thanks for your reply
I am very new to CR so I could not understand second part of your reply starting from
create query ....
I know how to prepare DSN in database
for your information I am giving you some hints
my dsn is exp
my database file path is C:\home\exp.mdb
database field are billno, chequeno, chequedt,month
In vb form I've placed crystal report control , one text box (text1.text) and one command window.
my problem is - when I run the VB and type "January" in text1.text and click the command botton the report should contain all billno,chequeno,chequedt pertaining to the month of January
similarly if I write February the report should contain all billno,chequeno,chequedt pertaining to the month of February.
I know the query statement to retrieve data from database to grid in VB that is written as :-
Select * from exp where month=' " & text1.text & " '
but I dont know the statement to retrieve the data from the Report
So I shall be grateful if you write the step by step procedure. I am dummy so far as CR is concerned.
thanks for your reply
I am very new to CR so I could not understand second part of your reply starting from
create query ....
I know how to prepare DSN in database
for your information I am giving you some hints
my dsn is exp
my database file path is C:\home\exp.mdb
database field are billno, chequeno, chequedt,month
In vb form I've placed crystal report control , one text box (text1.text) and one command window.
my problem is - when I run the VB and type "January" in text1.text and click the command botton the report should contain all billno,chequeno,chequedt pertaining to the month of January
similarly if I write February the report should contain all billno,chequeno,chequedt pertaining to the month of February.
I know the query statement to retrieve data from database to grid in VB that is written as :-
Select * from exp where month=' " & text1.text & " '
but I dont know the statement to retrieve the data from the Report
So I shall be grateful if you write the step by step procedure. I am dummy so far as CR is concerned.
•
•
Join Date: Sep 2007
Posts: 50
Reputation:
Rep Power: 2
Solved Threads: 0
Sir,
thanks for your reply
I am very new to CR so I could not understand second part of your reply starting from
create query ....
I know how to prepare DSN in database
for your information I am giving you some hints
my dsn is exp
my database file path is C:\home\exp.mdb
database field are billno, chequeno, chequedt,month
In vb form I've placed crystal report control , one text box (text1.text) and one command window.
my problem is - when I run the VB and type "January" in text1.text and click the command botton the report should contain all billno,chequeno,chequedt pertaining to the month of January
similarly if I write February the report should contain all billno,chequeno,chequedt pertaining to the month of February.
I know the query statement to retrieve data from database to grid in VB that is written as :-
Select * from exp where month=' " & text1.text & " '
but I dont know the statement to retrieve the data from the Report
So I shall be grateful if you write the step by step procedure. I am dummy so far as CR is concerned.
thanks for your reply
I am very new to CR so I could not understand second part of your reply starting from
create query ....
I know how to prepare DSN in database
for your information I am giving you some hints
my dsn is exp
my database file path is C:\home\exp.mdb
database field are billno, chequeno, chequedt,month
In vb form I've placed crystal report control , one text box (text1.text) and one command window.
my problem is - when I run the VB and type "January" in text1.text and click the command botton the report should contain all billno,chequeno,chequedt pertaining to the month of January
similarly if I write February the report should contain all billno,chequeno,chequedt pertaining to the month of February.
I know the query statement to retrieve data from database to grid in VB that is written as :-
Select * from exp where month=' " & text1.text & " '
but I dont know the statement to retrieve the data from the Report
So I shall be grateful if you write the step by step procedure. I am dummy so far as CR is concerned.
•
•
Join Date: Sep 2007
Posts: 50
Reputation:
Rep Power: 2
Solved Threads: 0
The Zip file is not opening even after log in with daniweb as such I once again request your goodself to send the zip file at my email id - kehar2005@gmail.com as attach file ple.
Thanks
K.S. Chhetri
Thanks
K.S. Chhetri
are u using internet explorer?
might IE is not supporting this download
download mozilla firefox browser from http://www.mozilla.com and try the download from that browser.
i'm telling you because i've tried downloading the file using firefox and it was successfully downloaded.
might IE is not supporting this download
download mozilla firefox browser from http://www.mozilla.com and try the download from that browser.
i'm telling you because i've tried downloading the file using firefox and it was successfully downloaded.
ok, for ur convenience i've sent it to ur mail.
check it and for further references if u wish can mail me at choudhuryshouvik@gmail.com
regards
Shouvik
check it and for further references if u wish can mail me at choudhuryshouvik@gmail.com
regards
Shouvik
•
•
Join Date: Sep 2007
Posts: 50
Reputation:
Rep Power: 2
Solved Threads: 0
Sir,
When I run the programme prepared by you the following error is shown
Run time error 20599
Cannot open SQL Server
So what is this error how is this rectified.
secondly when I tried to open your report only and tried to see the preview it ask for number of things how is this prepared and why ?
K.s.
When I run the programme prepared by you the following error is shown
Run time error 20599
Cannot open SQL Server
So what is this error how is this rectified.
secondly when I tried to open your report only and tried to see the preview it ask for number of things how is this prepared and why ?
K.s.
![]() |
•
•
•
•
•
•
•
•
DaniWeb Visual Basic 4 / 5 / 6 Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- getElementsByName() generates undefined ouput value in a textbox (JavaScript / DHTML / AJAX)
- How to Search record from the Sql Server Database (ASP.NET)
- Issue about passing parameter to Crystal Report 11.. (Visual Basic 4 / 5 / 6)
- query run successfully in sql*plus but return 0 records affected in vb6 (Visual Basic 4 / 5 / 6)
- passing variables threw query (MySQL)
- Need Help connecting to a view (MS SQL)
- while() not looping... (PHP)
- create a query in access from vb6 (Visual Basic 4 / 5 / 6)
- Stored Procedures in Oracle (Visual Basic 4 / 5 / 6)
- Can u pls help me in this scenario. (Networking Hardware Configuration)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: from list view to label
- Next Thread: CommandList


Linear Mode