Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Desired field not being accessed in Access database 1

Status
Not open for further replies.

TSC

Programmer
Jun 28, 2001
4
US
I have developed a reporting application using the Report
Designer Component within Visual Basic 6.0. A feature of
this application allows the user to browse and select
different Access databases (i.e. same tables and fields,
just different data) to generate the reports. I came
across a problem in testing that has to deal with the
order of the fields in a table of an Access Database. The
orginal database I used to create and develop the tables
work fine. However, when I used a different database, one
of my reports give the error "Division by zero". What I
discoved is that the fields in the table I was attempting
to access were not in the same order as the table in my
original database. Is the field order in an Access table
critical to the proper functioning of the reports that are
generated? I would appreciate any solutions on how to
resolve this matter.

Thanks,
Ted
 
This is curious, but I can see it happenning.
I would be surprised if you are using ODBC/SQL since the SQL statement shouldn't care about the field order, but I can't say for sure. Are you using ODBC to connect?

You could try the 'verify on every print' option and see if the verification (which updates the table structure stored in the report file) helps the problem. It was more concerned with field changes than table changes but it might help.

If all else fails you could create a recordset from the selected table and pass that to the report. If the report uses just one table, you could convert the driver to Active Data and pass it a recordset.

Ken Hamady
On-site custom Crystal Reports Training and Consulting.
Quick Reference Guide to using Crystal in VB.
 
Ken,

Thanks for your insight. I ended up talking with Tech Support at Crystal Decisions and they told me that maintaining the proper field sequence within the tables I am accessing among different database is critical. I am connecting to the Access database natively, and therefore I'm not using ODBC. Your are right though about ODBC/SQL in stating that the SQL doesn't care about the field order. I had the same thought. It seems to me that the RDC uses ordinal positioning when data is accessed natively.

Thanks again,
Ted
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top