Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

odbc drivers

ResolvedVersion 2003

Maisie has attended:
Access VBA course
Excel VBA Intro Intermediate course

ODBC drivers

Trying to connect to a Mysql database we have set up the database accordingly and connected it with the appropriate drivers but we are trying to connect to the databases tables with vba.

Currently we are using this

DoCmd.TransferDatabase acLink, "ODBC Database", _
"ODBC;DSN=DBname;UID=xx;PWD=xx;LANGUAGE=us _english;" _
& "DATABASE=tbl1", acTable, "Authors", "dboAuthors"

it connects fine but it pops up with the driver asking you to click okay how can we get disable this so it connects automatically without asking us to click ok

RE: ODBC drivers

Hi Maisie

Thank you for your question - can I just check does the dialog box present a message (and if so what does it say) and also does it offer an option to save your setting when you click OK?

Kind regards,
Andrew

RE: ODBC drivers

Its the standard input for a ODBC driver connection its put all our infomation in and just asks us to confirm it so it jumps out of the vba/access , the vba cant run until its done. Its not so much saving the settings rather entering them into the pop up and asking to click okay

Do you have any links or tutorials , that can push us in the right direction to actually accessing and using the data

RE: ODBC drivers

Hi Maisie

This is tricky to solve without seeing the database and obvious solution is to turn off the application's display alerts before the code runs and then switch them on again after.

so



docmd.setwarnings false

(Your Code)

docmd.setwarnings true



Try this to see if it works, if not let me know and I'll see if I can think of something else

Regards

Stephen

Edited on Mon 19 Jul 2010, 10:14

RE: ODBC drivers

I have fixed the previous error to not display the pop up. At the moment it connects to the database and links the table to MySql database which is what I need. In order to do this it needs to have a pre-defined odbc connection to be made using the driver or else it doesnt work.Even though I have defined the connection source in the code it doesn't seem to be working. I don't know where i'm going wrong.
Here's the code I am using:


DoCmd.TransferDatabase acLink, _
"ODBC Database", _
"ODBC;Driver = MySql ODBC 3.51 Driver;DSN=xxxx;ServerName=xxxx;ServerDSN=DIOMED;UID=xxxx;PWD=xxxx;StoreLogin=true;ArrayFetchOn=1;ArrayBufferSize=8", _
acTable, "tbl_1", "tbl_1"

RE: ODBC drivers

Hi Maisie

I have been speaking with my colleague Stephen about your forum posts and we have reached the limit of what we can arrange via the forum.

In order to find a solution the next stage will be to assess your actual working files. If we are confident of a solution we will prepare a scope of work including costs and durations for your review.

If you would like to discuss this further please let me know.

Kind regards

Jacob

RE: ODBC drivers

Sorry i dont want to pay you to answer my question as i have googled and fixed the error. It was just the two fields at the end which were not required.

:)

Maisie

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Access tip:

Change The Default Font in Access 2003

You can change the default font in Access 2003 so that whenever you create a new database your preferred font is automatically set.

To change the default font:

1.From the menu bar select Tools.
2.Click Options.
3.Go to the Datasheet tab:
4.In the Default font section select your preferred font from the list of fonts e.g. Arial.
5.Select your preferred size from the size menu e.g. 12.
6.Click Apply.

Click on the Tables/queries tab:
1.In the Query Design font section select your preferred font from the list of fonts e.g. Arial.
2.Select your preferred size from the size menu e.g. 12.
3.Click Apply.
4.Click OK.

The default font for Access has now been changed.

View all Access hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.09 secs.