473,396 Members | 2,093 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to place jpg files into an DataReport in VB6 under some condition

Hi,
I'm developing a VB project.
Description:
1. Printing all the records present in MS Access database using DataReports.

2. In database the following fields are there;
> Name > classID > AccessCode
This working fine.

3. I placed one image control in DataReport.
Here I've to place a .jpg file from a fixed location whose file name having same of that access code.

But this one I'm not getting.

Can you help me please....
Attached Files
File Type: zip Copy of BASE.zip (580.2 KB, 192 views)
Sep 9 '09 #1
1 2038
smartchap
236 100+
Dear Mr. Prem

I think u have taken this code from some site (probably from microsoft site) and tried to modify it. The problems with ur code (zip file posted by u) & their solutions are as below:

1. First, u have used x, q & z as counters but in ur code used only z. Due to this it searches for jpg file named as name of student (student field in table student) for clicked / selected record in DataGrid. Since u have named jpg files based on accesscode, it doesn't find a corresponding jpg file & gives error.
2. To overcome this problem use separate pointers for TextBox & Image Control.
3. When u click 'Show Data' connection is opened. Now if u click Print or Finalised Print, it gives error since connection is already open. So put a check for it.
4. Similarly for rs also.
5. Rename / Copy some .jpg files based on entries in student field and u will get output.
6. Design ur code properly with a SQL query so that output is for selected record only.
7. In command1_Click event modify code as
Expand|Select|Wrap|Line Numbers
  1. 'img = fldr & "\" & rs.Fields(rs(z).Value) & ".jpg"
  2. to
  3. img = fldr & "\" & rs(z).Value & ".jpg"
  4.  
I think edit ur code as above & get the result.
Anytime can ask for further help.
Sep 18 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Gary | last post by:
Dear Is it possible using ASP to call VB6 DataReport? if yes any reference of creating those com+ of DataReport and Call method? Gary
9
by: EkteGjetost | last post by:
I would like to first apologize to those of you who read my last post "desperately need help". As a regular on other forums i can understand how aggravating it would be to have someone come on who...
1
Awit
by: Awit | last post by:
Hello, I'm new here... I have a problem, I used DataReport in my program.. The problem is runtime error occur when i run the system, i can't make some modification at the table in database while...
0
by: myk | last post by:
Hi to all brilliant people I made a simple program in VB that will generate a summary report that can be sorted by date, but i had a problem in the datareport because it cannot have more than 8...
5
by: anoopgopal007 | last post by:
Hi, I am using vb6 and datareport. I am updating the tables whle the program running. But the datareport doesnot show the updated information. Its always shows the previous value. But...
6
by: pramodrepaka | last post by:
hi this is pramod i am facing a small problem Private Sub Command_Click() Dim a As String a = InputBox("enter empno") If rs.State = 1 Then rs.Close rs.Open "select * from microbiology...
1
by: kutsaratinidor | last post by:
hi to all im developing a payroll system thru vb6 it uses ms access as db datareport for printing some info why is it that .tmp files are being created..i think it happens whenever i am...
0
Ali Rizwan
by: Ali Rizwan | last post by:
Hi all, If i made some changes to a datareport suppose some updates are made then if i opens the report it is not updated. Datareport is connected to dataenvironment. If i use crystalreports does...
1
by: MaryKJolly | last post by:
I got this sample project from a website. But there is some syntax error in the statement which contains the CDate function. I can't detect the error? Can enybody help me? SUMMARY This article...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.