Working with access data

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
evilmonkey
Forum Regular
Posts: 823
Joined: Sun Oct 06, 2002 1:24 pm
Location: Toronto, Canada

Working with access data

Post by evilmonkey »

Hello all,

I am currently finding myself working in an unfamiliar environment. When asked to make sense of some data in MS Access, I poked around for a little, quickly chucking the GUI interface, and moving to good old fashioned SQL queries. I even found myself writing data import modules when a coworker came up to me, told me to close the window with my code in it, and go to file->import. Oh well, all part of the learning process (my code worked equally well if not better than the GUI import process :P )

But what I have to do now is create an access report. I have understood how to create reports with the data in the database, but I need to put in some logic in there. For instance, if there's one value in one column, I need a column in a report to be set to a certain value as well. In the PHP/MySQL world, this is pretty simple:

Code: Select all

$result = mysql_query("SELECT `field` from table",$db);
while ($row = mysql_fetch_tow($result)){
if ($row['field']=="value"){
$something = 1;
}else{
$something = 2;
}
//etc
}
In Access, I can't seem to recreate the mysql_fetch_row() part...How can I actually get access to the data from within VBA? And once I have that data, how can write it to an access report?

Thanks!

P.S. I'm a business analyst with some programming skills, not a programmer. :P Don't judge me too harshly.
User avatar
neophyte
DevNet Resident
Posts: 1537
Joined: Tue Jan 20, 2004 4:58 pm
Location: Minnesota

Post by neophyte »

Have you tried importing the data into Access and then just using the reporting tools in access to create the reports? There is a MYSQL ODBC driver. You can use Access to pull in the tables and then make reports in Access....

Hope I'm not missing the mark here...
User avatar
evilmonkey
Forum Regular
Posts: 823
Joined: Sun Oct 06, 2002 1:24 pm
Location: Toronto, Canada

Post by evilmonkey »

Yes, that's exactly what I did. Come to think of it, what I can do is import all the needed files as tables and run reports...it'll be a darn big database though (I'm talking a lot of gigs). So I was hoping to just read a file on the fly and take just the needed data as oppossed to importing these huge files and increasing the size of the database. These are not production databases, this is just data analysis, so I guess it doesn't really matter how efficient this is. We use oracle for production.

Sorry for not responding earlier, I was out for the weekend (no internet for 2 days is though man :P ) Thanks neophyte. :)
Post Reply