Beginner's Guide To Managing ODBC Datasources.

Nov 20, 2007

Having had little luck in getting any concrete information about effective ways to manage ODBC data, and after days of long trials and errors, I thought at least I could write up a summary of what I've found to work well for ODBC sources and hopefully others may be able to contribute to this.

Disclaimer: This is a far cry from being an authoritative and is woefully very subjective, being written by me and myself, using a MySQL server and Access 2003. I do hope that others who are able, can contribute more information to make this somehow more useful for those who would like to use Access as a front-end client.

There are three principal issues that must be considered when you are using a ODBC data sources:

1. Numbers of connections and different flavor of connections.
2. Size of recordsets and network traffic.
3. Binding forms to ODBC data sources.

As a starting point, one should read the whitepaper on Jet and ODBC Connectivity. (http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnaraccessdev/html/ODC_JetDatabaseEngineVersion30ODBCConnectivity.asp ) This was for Jet 3.0, but should be valid for 4.0 as well.

ODBC Driver and Connections

The next thing is to understand what your ODBC driver is capable of. In a connection string, there is a parameter for "Options", which is usually a long integer. You should look at the ODBC driver's manual to ensure you have all options you need turned on. A good example would be to ensure that a certain data type is correctly mapped to Access's data type. In my case, I ensured that Big Integer (64-bit) were turned off because Access does not support this (and thankfully, I don't need it anyway).

By far most important thing you want to look for is to ensure that the driver supports two things- Multiple statements and Active statements. Jet does try to pool all queries to the server into one connection whenever possible, but if the driver cannot support multiple statements over single connection, Jet will open another connection to submit a statement. Therefore, if you have a form that has a combobox, Jet will send two queries, one for form's recordsource and another for combobox's rowsource. In case of lack of support for multiple statement, Jet will need two connections.

Even if your driver supports multiple statements, Jet may find it necessary to open a second connection if the driver cannot have more than one active statement. Active statement is when you fetch a big recordset and need to wait a bit for the full set to come over the wire. So back to that form with a combobox, if Jet find that the form's recordsource will take a while to be fetched, it will go ahead and open second connection to populate the combobox in order to allow for 'instantaneous' loading of a form from a user's POV.

Wherever possible, keep numbers of connection to a minimum. As mentioned before, Jet will try to pool all statements into one connection wherever possible, but Jet cannot help you out if you issue a query using a new ADO connection, DAO ODBCDirect workspace, or create a recordset within VBA. If you want to avoid the additional overhead of another connection, you should use a stored query instead, and make sure it has a Connection string in its query property window set, so Jet knows that it uses ODBC data and pools it with its open connection to the ODBC server. The stored query can then be called within VBA without incurring another connection.

DSN and DSN-less/ODBC and OLE DB connections

There are two ways to create connections, by using Data Source Name (DSN) or direct connection. To find right connection string, look at Carl Prothman's excellent website listing all possible connection strings (http://www.carlprothman.net/Default.aspx?tabid=81).

Some people say connecting to DSN is better than without. Others say it's faster without DSN. One thing for sure is if you use DSN, you will need to distribute the DSN file to your users along with the finished database. I would recommend experimenting with both connection flavors before deciding which is better suited for your needs.

To make a DSN connection DSN-less, look at Doug J Steele's example (http://www.accessmvp.com/DJSteele/DSNLessLinks.html) or perhaps this Add-in by Paul Litwin (http://www.mvps.org/access/modules/mdl0064.htm).

Also, make sure you know whether you have different drivers available. I know for an example, some people prefer third-party drivers for Oracle over one supplied by Oracle themselves. Furthermore, some drivers are OLE DB which is supposedly better than ODBC (I say supposedly only because I am skeptical of Microsoft's promises of new and latest technology superseding a older technology, then dropping their claims and going back to older technology).

Binding forms

To Jet's credit, it is quite intelligent in retrieving just enough rows to populate the bound form, and will continue to fill up the recordset periodically while a user is working on a row. However, Jet has some quirks where it can do something very stupid, such as asking for multiple full table scans.

If you bind a form to ODBC table, Jet will do a full table scan. The simplest solution would be to add a WHERE clause to make the recordset smaller. But by far the better solution would be to set the recordsource's connection string to use ODBC instead of "(current database)". Jet will then query for keys, which it must have locally in order to manage a recordset, then afterward query a few rows at a time. If you can manage to keep keys smaller, all the better.

Furthermore, if you want to use subform, do not use Master/Child linking fields. This makes Jet go ape-shit, issuing several queries to show tables and index which is quite unnecessary. Rather, leave the link blank, and set subform's recordsource with a WHERE clause to match the parent form's key, so Jet will only ask for rows that match the key only without asking for indexes and table status every time you move around.

An additional benefit of making all queries for forms' recordsource an ODBC query is that you now have more control over how you handle those forms *with* Jet's intelligence. For example, you now can start transaction across multiple forms with subforms and commiting/rollbacking as you see fit, which would have not been possible using Access itself. I have been able to rollback the changes in two parent records and their related child records by issuing a SQL Pass-through query which simply says "Rollback;" and nothing was changed for any one of records, just as expected.

If you have a combobox or listbox on a form, this will mean another query in order to fill in the rowsource. Ideally, you want to keep some tables local to front-end clients, especially for tables that will never change (e.g. a list of states or provinces for example). For tables that may be updated peridocially but is otherwise select-only, you need to decide whether you want to make it a dynaset or a snapshot. For a small set, snapshot is faster, but for a larger set, dynaset is faster. You will need to experiment with the rowsoource to ensure that the network traffic and time to load the rowsource is satisfactory.

One problem is that Access won't accept an variable (at least I have been unable to do so) for a stored query's connection string, so if you need to change a connection string (e.g. you want to use different set of options, perhaps?), you would need to do this by hand, or at least write a function to loop through queries and updating the connection strings. Haven't tried that yet, but would imagine this is very possible.

Keep an eye on SQL log when developing

You definitely will want to have the server write a log of what queries it has received from Jet to give you feedback in ensuring that Jet doesn't do anything stupid. This has told me far much more about Jet than working within Access environment.

Unresolved issues

There is only one thing I haven't yet worked on- Sharing a recordset for different controls. Suppose we have a form with a combobox and a subform, both which use same table as a rowsource and recordsource, respectively. In this case, Jet will issue two separate query to the server, even if they may use same recordset. If anyone has been able to show how to get such controls to share recordset, that would be cool.

Also, I'm a bit worried about scattering connection strings all over the place, especially that it will contain a password. As I see no point in asking users to authenicate themselves every time they use a query with a ODBC connection string, given that variables can't be used in query's connection string. Would MDE make this less of a problem (I do not know if password still can be plucked out from a hex editor?). A possible solution is to synchronize Access's security with the server's security, because Jet will try to use Access's user & password for initial connection, and if a call to retrieve password was made along with a module at startup to 'fix connections' along with updating the connection string with the entered password, this may help somehow with keeping the password secret? Does anyone have more information on that?

External Link

A useful FAQ (http://archives.postgresql.org/pgsql-interfaces/2000-07/msg00193.php) for linking Access with Postgresql which may be useful in giving you some ideas of how you can work with Access.
If anyone wants to contribute to this, please do feel free to do so. If anyone finds anything that is dead-on wrong, please give me a good can of whoop-ass- I hate to lead blind into ditch, so to speak. :)

View Replies


ADVERTISEMENT

Need Guide Please.

Oct 23, 2006

Hi,

I have created a simple database named: tblcustomer.mdb with fields of Company, Address and Tel

I would like to create another database which records the jobs that I have done for these companies. I name it tbljobrecord.mdb with fields of Company, job 1 and job 2

My question is, how can I link the Company field (tblcustomer) with the Company field of (tbljobrecord) so that everytime I add in a new Company (tblcustomer), it will be updated on the tbljobrecord too.

Thanks.

View 3 Replies View Related

TV Guide Database

Apr 7, 2006

I am trying to write a query showing me all tv shows on right now.

The design of the tables are unchangeable because they are given to me.

The 2 important fields in the Schedule table are:

time (which is a date/time value, for when the program starts ex: 2/3/05 8:30AM)

durations (a number giving the program lenght in minutes ex: 60 (1 hour)

I want to write a query showing me what is on right now, then problem is I do not want to use MSAccess functions like DatePart or Cint ect... because the SQL from this query will be used through on a webpage using a jscript activex ADO connection and I dont think Functions like DatePart() are supported.

Thanks

View 1 Replies View Related

Know A Good Guide To Query Syntax?

Sep 12, 2006

I'm new to Access and have been learning how to use it for the better part of a year. I've done all the Microsoft online tutorials relevant to the work I need to do with it, and gotten a few books out of the library besides. In general, I self-teach very well given a good resource.

Here's my problem: the main area in which I need to be proficient is running queries, and I cannot find a good, comprehensive explanation of how to construct expressions or set up calculated fields.

In case I'm not clear (I've had quite a time just figuring out what to call what I need), I'll give you an example. I was able to arrange a short tutorial with someone in another department. As part of a query, she used the following statement in the "Field" section to convert date information stored as mm/dd/yyyy into just the year:

Year: IIf([referraldate]<#1/1/2003#,"2002",IIf([referraldate] Between #12/31/2002# And #1/1/2004#,"2003",IIf([referraldate] Between #12/31/2003# And #1/1/2005#,"2004",IIf([referraldate] Between #12/31/2004# And #1/1/2006#,"2005",IIf([referraldate] Between #12/31/2005# And #1/1/2007#,"2006")))))

This is the kind of thing I want to learn how to do. Unfortunately, the Microsoft tutorials don't do much more that give examples of different expressions and functions; I feel like I've been given a handful of sample sentences, a few nouns, and a few verbs--and then told to go speak English.

What I need is a comprehensive guide that not only gives me the building blocks of expressions, but tells me how to combine them into a syntactically meaningful statement--so I know what order things go in, where commas and parentheses should be, etc. Both online or print materials are fine--I've been looking on my own, but with no luck.

Thanks for your help!

View 5 Replies View Related

General :: Managing A Many-to-one Relationship From One End

May 10, 2013

use of a query, or a report or it could involve changing the table structure.Say I have a many to one relationship, for simplicity we'll call the table on the 'many' side tblThing and the table on the 'one' side tblGroupofThings.When managing the records in these tables it is important that each Group of Things contains at least one Thing, but it isn't important that each Thing is part of a Group of Things.

Things and Groups of Things are constantly being added to the table. As I see it, the only way to manage this is from the Things table, or at least a form based on the Things table, as I am editing a foreign key for tblGroupofThings inside tblThings. However it would be easier for me to manage it from the Groups of Things end, so that my workflow goes as follows:

-I add a new Group of Things to tblGroupofThings,
-I then 'put inside' that Group of Things, the Things that belong inside it (i.e. make the foreign key field in those Things point to the Group of Things.

Managing from the Things end means I have to start of with the new Groups of Things which are 'empty' at the moment, decide which things need to go in them then swtich to Things and remember which Things need to go into which Groups of Things.all the talk about putting records inside other records when I'm really talking about foreign keys. I know that's not know it really works but to the user that's how it should appear to work.

View 14 Replies View Related

Suggestion On Managing Priorities In A Form

Sep 19, 2006

I'm writing a task tracking database to be used during staff meetings. Each task should be assigned a priority, and no two tasks should ever have the same priority. Easy enough.
Here's where I could use some suggestions. If I have a new task, what would be easiest way to manage that insertion (assuming it has a higher priority than the lowest item), without having to renumber all the other items in the table?

View 1 Replies View Related

General :: Managing Contact Emails

Sep 11, 2012

I work for a firm who have a few thousand clients and we are wanting to go through a process of checking with them that the data we send them is going to the email address they would like it to go to. However in some cases we don't currently hold an address so we are contacting them by phone to get the addresses over the next few weeks.

The way I've chosen to do this is to use the excellent link between Access and Outlook to send an email to the address we have on file (or have gotten) with a very light form they can optionally fill in to update the email address if desired.All seems well in testing this with 2 exceptions:

1) I have 2 email boxes in outlook, my "personal" one and a group mailbox. I'd like the emails access sends to come from the group mailbox but cannot see an option to control this.

2) We're likely to send the emails out in tranches - is there a way to have a single table the drives the email process but some how have it know that we have sent the emails out for certain clients such that when I send a second tranche, it doesn't re-send to clients that have already been contacted?

View 2 Replies View Related

Managing / Syncing Database On Multiple Computers?

Jun 25, 2015

I have an estimating database, the "main" database is on my desktop, then it is also on a Notebook and Laptop and goes out with the bidders. At the end of the day, I want to sync all 3. I may enter info throughout the day on my desktop (which needs to sync up to the other 2) and vise versa. Using SharePoint is not an option as the Notebook and Laptop will not always have internet access.

View 1 Replies View Related

Reports :: Database For Managing Time Related Contracts

Jan 24, 2014

I have a database for managing time related contracts.

I need to be able to run parameter queries but if I query the data by start date then and contracts which are current but started before the first date entered in the query (this is the same for end dates) are not shown.

View 2 Replies View Related

Tables :: Create Database For Managing Nonconforming Product Internally

Jul 25, 2014

I am attempting to create a database for managing nonconforming product internally.

Different stages will need to be assigned to an individual within the organisation, is it possible to have a lookup value in my table which draws its information from active directory?

All the users are obviously in here and managed already, I dont want to have to create and manage a separate list of users just for my database.

View 2 Replies View Related

I Am A Beginner, Please Help.

Sep 7, 2005

I have created a new Access database and need a few additional things that I would like to add. I created a database for inventory within my company. Only a few people will have access to it so security will not be an issue. However, I have a couple questions. Is their a way to have a popup when you open the database to insert let's say the serial number of the computer (already in my forms) and then it will automatically bring up that information. Also, I do not want any of my forms edited. I want this done strictly through the tables. So this leads to my next question. Is their a way once you have a form up that you can enter a different serial number and the information will automatically populate. If not, can you add a search query or option or what needs to be done. Thanks in advance for your help.

View 4 Replies View Related

2 Q's From A Beginner

May 4, 2006

Hi

I'm not sure if I have posted this in the right section, but i'm sure someone will tell me.

I have 2 questions, first is about concatenation.
I've looked endlessly & have tried a few scripts, but all to no avail.

eg db:
Name: Dpt:
Tom sales
John sales
Jerry mgm
Albert sales
Keith mgm

eg report that I want
Sales - Tom, John, Albert
MGM - Jerry, Keith

What is the best way to do that?

2nd Question.
In the same db, what i'm wanting to do is if I change the data in any record, it will track the changes.

eg
Albert has changed departments from sales to management (mgm as above), and so when you view albert's information, you can do something to pull up any & all changes made to that particular person. Any ideas there! Once again, i've searched the net and can't seem to find the best result.

Cheers in advance!

View 2 Replies View Related

A Beginner Need Help

Jun 14, 2006

Hi,

I am just a new greenhore learning ms access and I am planning for a warehouse/inventory storage database.

My question :

1) I have 4 product division (Do you think it is good to have 4 tables):confused:
2) The calculation field. (How does the mechanism work when I take the the item out from the inventory, it will show as total storage -1 (eg, the storage have 5 units and I took 1. it show balance left 4).:confused:

About question 2, is it that I have a to do separate table again.

Temporary, I have these 2 problems and hope all access expert can help.

Regards,
Richard

View 1 Replies View Related

Beginner Help

Mar 14, 2008

I am fairly new to access and am trying to put together a project for work. I need to be able to create a list of all of the employees and which team they are in. So no problems with this.

I also need to be able to mark in their records where they can advertise and the quota they have. Each employee may be able to advertise in more than one location.

What I would like to create is a form for each team that displays the employees and where they can advertise. So far I have managed to get a subform to show this for each office but each employee has record for each job board. See Picture1.http://i112.photobucket.com/albums/n170/nharri/1-1.gif

Ideally I would like something like picture 2.
http://i112.photobucket.com/albums/n170/nharri/2-1.gif

Is this possible?

View 1 Replies View Related

Beginner Need Help

Feb 22, 2006

Hello!First of all I am new to these forums and I'm also a beginner with Access so have patience :) and I don't know if this thread is in the correct part of the forums so if a moderator feels like it's not feel free to move it.Me and a friend are interns at a company in US and the company assigned us to gather data from several excel sheets and build a completely new database. This database contains several tables.This isnt the correct names of the tables, it just to give you an idea how it looks at this moment.Customer information. (key: Customer ID)Resellers (Key: Reseller ID)Newsletter subscriptionsProducts (Key: Serial Number)Software (Key: Licence) Product2 (completely different product from the others) (key: Serial number)Invoices (Billing information, debit, credit, etc) (key: Invoice ID)OK, that explains how our tables looks like. And ofc in the tables we have different fields.Our problem at this moment is our form. Because we want to use a form to enter the data. We believe that it will be the fastest way and the easiest.I have a picture for you to show you our problem.It seems like the FORM is looking in the same table. But we want all the "fields" in the form to represent its own table. We tried to gather all tables into 1 Query and use the query when we created the form, the problem dissapears BUT a new one comes along. If we use a query in the form we can fill out all the fields but we can't create a new "record" with empty fields to enter more data hence leaving us with only one record of information. This is realy starting get on our nerves. Can someone help us?

View 1 Replies View Related

Dlookup Help /beginner

Apr 3, 2006

Hi there, Heres my situation
I have a basic form for a customer shopwing all general details the top field is Customer ID in which I would like to enter a customer ID and for the rest of the data to appear for that customer in the remaining fields, I have a small amount of knowledge with access and believe I need to a Dlookup but I am unsure where and how to put this expression i'm thinking maybe in a query. Any help would be great, My field names are listed below to make any help a little clearer

Customer ID field = txtCustomerID

Linking to = tblCustomers

to find = txtSurname
txtForename
txtPostCode etc

Many Thanks

View 1 Replies View Related

Very Beginner Question

Jun 30, 2006

Hi this should be very simple, but it's not for me.
I am creating a database logging machine error's.
Each error has a recorded start and end time, which I enter.
I want the database to enter the elapsed time into a third field, 'ElapsedTime'.
I see how to do this in the builder, just subtracting the two fields. But I know not to make it a condition of my query, that doesnt make sense. Where do I put my expression so that my table updates itself with the new field?

Thanks!

View 3 Replies View Related

Beginner Question!!!

Nov 6, 2004

I am creating a database concerning products sold.

I am a beginner of using Access Database and would like to know if this is possible...

At the designing stage of tables and relationships is it possible to link and construct, so that the stock quantity of each product is kept up to date. so, when an order is made of produc '123', product '123' updates it stock quantity be deducting the quantity ordered.

attached are the tables/fields/relationships.

Thank you very much.

View 1 Replies View Related

Beginner Needs Expression Help

Jul 27, 2007

I need to figure out how to program an expression that will reset a value on a form to zero if the product of it's calculation is less than zero.

I am figuring out sales commissions for listing Ebay items and there are some instances where the item doesn't sell, so it's a net loss because of the fees Ebay charges to list the item. I have programmed the form to take 10% of whatever the net gain is and use that as the salespersons commission. But in instances where the item doesn't sell, it actually takes money away since 10% of a negative number is a negative value.

In cases like this, I need the expression to just show a zero, if the number is negative.

If anyone could help, I would be greatly appreciative.

View 1 Replies View Related

Please Help Beginner With Football D/b Design

Nov 30, 2005

For a couple of years now I have been keeping a spreadsheet record of UK football match results and statistics - I use this as the basis for gambling on future matches. I now want to migrate this information into a database so that

1) It is much easier to enter the new data(via picklists)
2) I can generate reports on particular teams to help me on future betting decisions

Being almost completely new to Access I am struggling with the design. The information I'm capturing is:
Match Date
Competition(table including five)
Home team/away team(table including many depending on competition)
Home formation/away formation(table with standard list)
Home goals/away goals(numerical)
Home corners/away corners(numerical)
Home bookings/away bookings(Numerical)
Referee(from a standard list)
All the above is in a match results records table with relationships to each data element table.

For the form for data entry, I want pick lists for all non-numerical values - eg team, formation etc. I would like to get a little cleverer and for the team pick list to only contain teams that are in the competition I've selected(eg Uk or European).

I've created some tables and relationships, but when I create a simple form with combo-list boxes, the list itself comes up blank even though I've linked the field to a particular table of options(eg a competitions table).

Can anyone help on suggestions for the overall design(should I have separate match results tables and team tables for each competition?) and with this particular combo-box problem please?

View 3 Replies View Related

A Beginner Access Problem.

Jan 5, 2006

Hi all. Had a quick peruse and this place seems really helpful, lets hope you can help me out here.

I have a project to do which roughly described is engineers doing jobs on aircraft. Three main tables:

Engineer
Booking
Job

The job table denotes the work required on an aircraft, with a unique barcode for the "job card". The Engineer table contains information about our engineers, with a unique ID.

Now here's my problem. The booking table needs to store information from both of these tables, but store it seperately. So I need to take some information from Engineer (ID, name, trade etc) and some from the Job table (barcode, description etc) and store it again in the "booking" table along with a few other "new" fields unique to the booking table. When this "booking" is made, it must record the start time, furthermore when the record is returned to later and closed, the duration of it being "open" must be worked out (total job time).

Ideally I'd like to create a form whereby I drop down a combo box and select an engineer (or type and autocomplete) it fills in the rest of his details, I then drop down another box and select a barcode (or again autocomplete) and that completes the rest of the job details. I then type in the new fields I also need, and this all gets stored in the "booking" table.

Any help greatly appreciated :)

I'm working with A2K3 for clarification, and can post/email my current database if required.

Thanks :)

View 7 Replies View Related

Database Beginner Question

Jan 11, 2007

I've searched and could not find what I was looking for.
I have NO database experience but need to learn quick

I have an html page with an iFrame (flash menu on left - iFrame on right)
When I click a product image on the left this is what I need to happen.
- Flash send a variable
- The iFrame to load an HTML page that will populate with an image, 2 text fields, and 3 hyperlinks dependant on what product is clicked in the flash.

I am using access since it is what i have at work, and i can just add all the products in a table pretty quickly and easitly. I set up a table in access with the image, hyperlinks, and text that needs to populate in the html page. The HTML page is set up in tables if that makes a difference...

I just don't know where to go from here to make my connections and how to set it up.

Any help would be appreciated.

Thanks in advance.

View 2 Replies View Related

New To Access - Beginner Question

Feb 8, 2007

I downloaded a database of historical baseball stats recently and having been playing around with Access for a bit although frankly, I haven't been able to learn or do much. Anyways, here's my question:

I have one table that is a master list of all the players. The two main things I'm worried about are the playerID and the birthyear (year of birth). In another table I have batting stats from the players from each year they played. However, it is missing the year of birth which I need to calculate the age in that year. So, I need to get the birthyear from the master table and put it into the batting table next to the corresponding ID. Most players played for multiple years so then for everytime a playerID occurs in the batter table, I have to insert the corresponding birthyear from the master column. Hope that makes sense.

As I said, I'm completely new to this kinda stuff so any help or tips would be greatly appreciated.

View 5 Replies View Related

Organising Files For Beginner.

Oct 18, 2007

Hello all. Would anyone be so kind as to help me out with this beginners problem. I have a lot a books which i'd like to sort into categories. I'd like to be able to select a category from a combobox on a form, and for relevant books in that category to appear in a listbox. Upon clicking on a particular book on the listbox, relevent info should appear on the form eg. date purchased,author etc.
Is it also possible to have an option to view all books from a particular genre in spreadsheet format embedded in the form, and an option to view every book regardless of genre. I'd then like to be able to print reports on each/all. I'm sure i'd be able to manage if someone could kindly get me on the right path with an example.

Thanks,

Richard.

View 3 Replies View Related

Relationship Help Required By Beginner

Nov 29, 2005

Hi all,
I am a novice database user, having only ever used simple databases.
I need to produce a database which stores the path to images.
I want to design a database with a table of Items with fields such as :-

ItemID
ItemName
ItemDesc
ItemCategory
ItemPhoto

each item may have many photos of the item, but I will not know the exact amount, although probably less than 10 photos per item.

Photo will have details (fields) such as :-

PhotoID
PhotoName
PhotoPathURL
PhotoDesc

I realise that each item can have many photos, but a photo can only have one item.
Would I need a table to link these two tables?
Your advice greatly appreciated.

View 6 Replies View Related

Designing Tables - Beginner

Nov 28, 2006

Could someone please help me with the following.

I have a form that gets some basic information...

My table looks like the following..

NewApplicationID
ClientName
ClientAddress
ClientPhone
ClientEmail

later on down the road, we will be inputing other fields, is it possible to have another form for specific information, that would be linked to this....

thanks for any help

Josh

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved