PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > comp.databases.mysql > Trouble connecting to MySQL db from VB6 using ODBC
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Trouble connecting to MySQL db from VB6 using ODBC

Réponse
 
LinkBack Outils de la discussion
Vieux 28/03/2008, 18h31   #1
Martin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Trouble connecting to MySQL db from VB6 using ODBC

I've installed MySQL (version 5.0.51a) and am trying to learn to use
it in a program written in Visual Basic 6. The VB6 program has been
using both ADO and DAO to manipulate data in an MS Access MDB file.

Using the examples shown here:
http://dev.mysql.com/doc/refman/5.0/...ramming-vb-ado
I'm trying to use ODBC to access the same data (I imported it into the
MySQL database) and have succeeded with the ADO part. But, I'm getting
an error when I try to open a DAO connection (it's an unspecified
error - a message box pops up that contains only a red "X" - no error
message).

To track this down a little further, I copied the example code from
the page linked above into a new VB program. When it gets to the line:
Set conn = ws.OpenConnection(..., it generates a run time error 3146 -
"ODBC - call failed".

I've googled around quite a bit on this but haven't been able to find
a resolution. One thing said to be sure that MDAC is up-to-date.
AFAIK, it is - although I don't know how to check that specifically
(the computer itself is running WinXP Pro with all service packs and
updates on it).

FWIW, I'm using the DAO 3.6 object library.

Anyone here have any experience with this situation that might be able
to point out what I'm missing here?

Thanks
  Réponse avec citation
Vieux 28/03/2008, 23h21   #2
Martin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Trouble connecting to MySQL db from VB6 using ODBC

On Fri, 28 Mar 2008 10:31:36 -0700, Martin <ironwoodcanyon@gmail.com>
wrote:

>I've installed MySQL (version 5.0.51a) and am trying to learn to use
>it in a program written in Visual Basic 6. The VB6 program has been
>using both ADO and DAO to manipulate data in an MS Access MDB file.
>
>Using the examples shown here:
>http://dev.mysql.com/doc/refman/5.0/...ramming-vb-ado
>I'm trying to use ODBC to access the same data (I imported it into the
>MySQL database) and have succeeded with the ADO part. But, I'm getting
>an error when I try to open a DAO connection (it's an unspecified
>error - a message box pops up that contains only a red "X" - no error
>message).
>
>To track this down a little further, I copied the example code from
>the page linked above into a new VB program. When it gets to the line:
>Set conn = ws.OpenConnection(..., it generates a run time error 3146 -
>"ODBC - call failed".
>
>I've googled around quite a bit on this but haven't been able to find
>a resolution. One thing said to be sure that MDAC is up-to-date.
>AFAIK, it is - although I don't know how to check that specifically
>(the computer itself is running WinXP Pro with all service packs and
>updates on it).
>
>FWIW, I'm using the DAO 3.6 object library.
>
>Anyone here have any experience with this situation that might be able
>to point out what I'm missing here?
>
>Thanks


OK - got it working.

If I use a DSN, it all works properly. I didn't particulary want to
use a DSN but, if that's the only way to do it...


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 19h18.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10260 seconds with 10 queries