×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

ODBC connnection call fails

ODBC connnection call fails

ODBC connnection call fails

(OP)
I have tested the ODBC DSN and it works but the following code statement fails with error: ODBC - call failed:

CODE

Dim Conn As Connection
Set Conn = wsODBC.OpenConnection("Conn1", , , "ODBC;DSN=IBSMSbloem;") 

What can be the problem?

Thanks

PK Odendaal

RE: ODBC connnection call fails

Not enough information. Did you define it as a 64-bit DSN?

In any case DSNs are generally a bad idea, especially system DSNs. Just put the details into the connection string instead.

RE: ODBC connnection call fails

dilettante,
Thanks for your reply, which I always regard highly.
I do not know how to establish whether it is a 32 or 64 bit DSN and what it should be. I am using vb6 with MySQL.
How would I specify the DSN in the connection object if it is not registered under the System DSN? If you could help me getting the connection string right I will appreciate.
Thanks.

RE: ODBC connnection call fails

It is a 64 bit driver.

RE: ODBC connnection call fails

I could not get the 64 bit drivers to work. I installed an older 5.3 32 bit driver and that works. The connector string that I use is

CODE

strConnect = "Driver={MySQL ODBC 5.3 ANSI Driver};Server=YourServerIP;Port=3306;Database=YourDatabase;User=YourUserName;Password=YourUserPass;Option=3; 

David Paulson

RE: ODBC connnection call fails

Hi David,
I think you are right and thanks so much for the tip.

I found this excellent link for installing and registering the myodbc5a.dll file (for ANSI)in the correct folder:
https://dev.mysql.com/doc/connector-odbc/en/connec...

I did register it - see attachment 01, but I am still unable to use the 32 bit driver due to error code 193.
This link explains error code 193, but I seem unable to solve the error: (see attachment on next message)
http://www-01.ibm.com/support/docview.wss?uid=swg2...

Any further help will be appreciated.
Thanks.

RE: ODBC connnection call fails

What OS are you using? I don't set up a system DSN, As long as the driver is listed in the ODBC Data Source administrator (32 bit) you can use it.
Just substitute your information in the connection string and it should work.

CODE

Public Conn As Connection
Public strConnect as string
Set Conn = New Connection
Conn.CursorLocation = adUseClient
strConnect = "Driver={MySQL ODBC 5.3 ANSI Driver};Server=YourServerIP;Port=3306;Database=YourDatabase;User=YourUserName;Password=YourUserPass;Option=3;"
Conn.Open strConnect 

David Paulson

RE: ODBC connnection call fails


Hi David,
I am on Windows 7
I think you are using VB.NET or ADO. I am trying to use DAO.
Kind regards.

RE: ODBC connnection call fails

I'm on Win 10, but I have machines on Win 7 , and xp accessing the same Mysql database. I am using VB6 and ADO.

David Paulson

RE: ODBC connnection call fails

You must define the DSN using the 32-bit ODBC Administrator. On a 64-bit system people often run the 64-bit tool instead. That results in a DSN that 32-bit applications can't use because it is in the wrong format and points to a 64-bit ODBC Driver.

ODBC Administrator tool displays both the 32-bit and the 64-bit user DSNs in a 64-bit version of Windows

Quote (Microsoft)

To work around this problem, use the appropriate version of the ODBC Administrator tool. If you build and then run an application as a 32-bit application on a 64-bit operating system, you must create the ODBC data source by using the ODBC Administrator tool in %windir%\SysWOW64\odbcad32.exe. To indicate the type of DSN, you can add "_32" to the 32-bit user DSNs and "_64" to the 64-bit user DSNs.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close