Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

ODBC

mac_doggiemac_doggie Member Posts: 488
Does anyone know if it's possible to install an ODBC driver for MySQL so that I can acces my database through Visual Basic or Delphi?

Or can anyone tell me how else I could connect to a database from with in Visual Basic or Delphi ?

-mac-
;-)
-mac-
mailto:programmersheaven@mac-doggie.nl
the Netherlands...

Comments

  • JonathanJonathan Member Posts: 2,914
    : Does anyone know if it's possible to install an ODBC driver for
    : MySQL so that I can acces my database through Visual Basic or Delphi?
    Yes. MyODBC is what you're looking for, and you'll find it here:-
    http://www.mysql.com/products/myodbc/index.html

    : Or can anyone tell me how else I could connect to a database from
    : with in Visual Basic or Delphi ?
    You could always write your own driver...on second thoughts, I doubt you're insane or wish become that way. ;-)

    Hope this helps,

    Jonathan

    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

  • mac_doggiemac_doggie Member Posts: 488
    : : Does anyone know if it's possible to install an ODBC driver for
    : : MySQL so that I can acces my database through Visual Basic or Delphi?
    : Yes. MyODBC is what you're looking for, and you'll find it here:-
    : http://www.mysql.com/products/myodbc/index.html
    :
    : : Or can anyone tell me how else I could connect to a database from
    : : with in Visual Basic or Delphi ?
    : You could always write your own driver...on second thoughts, I doubt you're insane or wish become that way. ;-)
    :
    : Hope this helps,
    :
    : Jonathan
    :
    : ###
    : for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    : (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    : /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");
    :
    :


    Yeah thanks, I'd allready found it by myself but thanxxx anyway.....


    ;-)
    -mac-
    mailto:programmersheaven@mac-doggie.nl
    the Netherlands...


  • LAbluesmanLAbluesman Member Posts: 14
    : : : Does anyone know if it's possible to install an ODBC driver for
    : : : MySQL so that I can acces my database through Visual Basic or Delphi?
    : : Yes. MyODBC is what you're looking for, and you'll find it here:-
    : : http://www.mysql.com/products/myodbc/index.html
    : :
    : : : Or can anyone tell me how else I could connect to a database from
    : : : with in Visual Basic or Delphi ?
    : : You could always write your own driver...on second thoughts, I doubt you're insane or wish become that way. ;-)
    : :
    : : Hope this helps,
    : :
    : : Jonathan
    : :
    : : ###
    : : for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    : : (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    : : /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");
    : :
    : :
    :
    :
    : Yeah thanks, I'd allready found it by myself but thanxxx anyway.....
    :
    :
    : ;-)
    : -mac-
    : mailto:programmersheaven@mac-doggie.nl
    : the Netherlands...
    :
    :
    :
    ~~~~>> well, I have a follow-up question on this topic:
    I have already found and installed MySQL ODBC 3.51 on the Windows2000 client machine. On the server side: RedHat 7.3 running MySQL 3.23.xx. so, here's the Q: What needs to be done on the server side??? Does anyone know if this MySQL already has the ODBC installed and running on it?, or if I need to install it myself.. and if so, do I just grab the Linux flavor of ODBC off MySQL.com and run/install it?

    thank you for your time in advance!!
  • JonathanJonathan Member Posts: 2,914
    : ~~~~>> well, I have a follow-up question on this topic:
    : I have already found and installed MySQL ODBC 3.51 on the
    : Windows2000 client machine. On the server side: RedHat 7.3 running
    : MySQL 3.23.xx. so, here's the Q: What needs to be done on the
    : server side???
    Nothing, AFAIK. ODBC is system that provides a way for Windows apps to connect to a database, provided a driver is installed for that database. So the ODBC is just a client side thing.

    Jonathan


    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

  • LAbluesmanLAbluesman Member Posts: 14
    : : ~~~~>> well, I have a follow-up question on this topic:
    : : I have already found and installed MySQL ODBC 3.51 on the
    : : Windows2000 client machine. On the server side: RedHat 7.3 running
    : : MySQL 3.23.xx. so, here's the Q: What needs to be done on the
    : : server side???
    : Nothing, AFAIK. ODBC is system that provides a way for Windows apps to connect to a database, provided a driver is installed for that database. So the ODBC is just a client side thing.
    :
    : Jonathan
    :
    :
    :
    ok, so, then I guess my question should be this:
    is there anything that I should/need to do on the server side to get the computer with the MyODBC client and the server to talk to one another?
  • JonathanJonathan Member Posts: 2,914
    : ok, so, then I guess my question should be this:
    : is there anything that I should/need to do on the server side to get
    : the computer with the MyODBC client and the server to talk to one
    : another?
    I actually think your question should be "The client and the server! They won't talk to each other! It's the same problem you have with that girl you like, Jonathan!"...

    I can surely give you a checklist, which you might wanna run through. With any luck, one of these might be the problem:-

    1) Is the MySQL server running? (!)
    2) Is there a firewall stopping remote connections to it?
    3) Does the user you're trying to connect as have privileges set so you can connect from a remote system? You can make it so a user cannot login remotely, which isn't too helpful in this particular case. :-)
    4) Correct username and password? No, quit laughing. I've spent an hour playing with settings on an ADSL router 'cus it refused to connect. It turned out we'd got all the other settings perfect first time, but typo'd the password. We were so sure that wouldn't be it that nobody checked!
    5) Can you connect to the MySQL server locally (e.g. on the server it's hosted on)?
    6) Have you posted any error messages you get on this forum? No, which means you either don't get any (plausible) or you don't realise how useful I'd find them in trying to find what's up. :-)

    Hope this helps,

    Jonathan

    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

  • LAbluesmanLAbluesman Member Posts: 14
    [b][red]This message was edited by LAbluesman at 2003-11-25 9:49:26[/red][/b][hr]
    : : ok, so, then I guess my question should be this:
    : : is there anything that I should/need to do on the server side to get
    : : the computer with the MyODBC client and the server to talk to one
    : : another?
    : I actually think your question should be "The client and the server! They won't talk to each other! It's the same problem you have with that girl you like, Jonathan!"...
    :
    : I can surely give you a checklist, which you might wanna run through. With any luck, one of these might be the problem:-
    :
    : 1) Is the MySQL server running? (!)
    : 2) Is there a firewall stopping remote connections to it?
    : 3) Does the user you're trying to connect as have privileges set so you can connect from a remote system? You can make it so a user cannot login remotely, which isn't too helpful in this particular case. :-)
    : 4) Correct username and password? No, quit laughing. I've spent an hour playing with settings on an ADSL router 'cus it refused to connect. It turned out we'd got all the other settings perfect first time, but typo'd the password. We were so sure that wouldn't be it that nobody checked!
    : 5) Can you connect to the MySQL server locally (e.g. on the server it's hosted on)?
    : 6) Have you posted any error messages you get on this forum? No, which means you either don't get any (plausible) or you don't realise how useful I'd find them in trying to find what's up. :-)
    :
    : Hope this helps,
    :
    : Jonathan
    :

    ** UPDATE **
    first of all, sorry I dissappeared - had to jump projects for a bit.
    I tired some of your suggestions, and I think that there's a discrepancy (big word!!) between the ODBC driver on the client (3.51) and the server (2.50). reason I think this: I was trying to find the odbc.ini file, and in the process, open'd up some odbcinst.ini files and noticed no reference to 3.51, only 2.50.

    is there some way check the server to see what ODBC it's gonna running? and, if it is the older version, can you give some directions on how to update it to 3.51?

    THANKS!!!!!

    I will try your suggestions, thanks!!! :) I haven't gotten any error messages because this is our (and my) first time trying to get VB6 and MySQL to talk to one another, so we really didn't know where to start. we have gotten VB6 and a Unify database to talk to one another via the Unify ODBC driver (one driver on the server, one on the client), so, we have ~some~ experience.

    anyway, mucho thanks-o, and you'll be hearing from me in either success or failure.


  • LAbluesmanLAbluesman Member Posts: 14
    [b][red]This message was edited by LAbluesman at 2003-12-1 9:45:32[/red][/b][hr]
    : : ok, so, then I guess my question should be this:
    : : is there anything that I should/need to do on the server side to get
    : : the computer with the MyODBC client and the server to talk to one
    : : another?
    : I actually think your question should be "The client and the server! They won't talk to each other! It's the same problem you have with that girl you like, Jonathan!"...
    :
    : I can surely give you a checklist, which you might wanna run through. With any luck, one of these might be the problem:-
    :
    : 1) Is the MySQL server running? (!)
    : 2) Is there a firewall stopping remote connections to it?
    : 3) Does the user you're trying to connect as have privileges set so you can connect from a remote system? You can make it so a user cannot login remotely, which isn't too helpful in this particular case. :-)
    : 4) Correct username and password? No, quit laughing. I've spent an hour playing with settings on an ADSL router 'cus it refused to connect. It turned out we'd got all the other settings perfect first time, but typo'd the password. We were so sure that wouldn't be it that nobody checked!
    : 5) Can you connect to the MySQL server locally (e.g. on the server it's hosted on)?
    : 6) Have you posted any error messages you get on this forum? No, which means you either don't get any (plausible) or you don't realise how useful I'd find them in trying to find what's up. :-)
    :
    : Hope this helps,
    :
    : Jonathan
    :

    **UPDATE**
    ok,.. I'm a moron-monkey..

    everything is working just fine. the whole 'test.test' thing had to deal with the full naming of the database and a specific table. for those who aren't going "aaaahhh..", this means '.". so, in my case, there was no 'test' table in the database(my sql statement was : SELECT * FROM test). I should have used SELECT * FROM testtable - hence, 'test.testtable', which is correct.

    so, now that things are working just fine, I'll try to post up all the steps that are required for getting VB6 and MySQL to talk to eachother, for everyone else to use (and hopefully avoid the mistakes I've hit).

    **PREVIOUS MESSAGE**
    it's me again,.. I didn't know if editing the previous post (again) would signal something current had occured in the thread, so, this new response should fit the bill!

    ok,.. the ODBC entry in the ODBC administrator is successfully talking to the MySQL DB (hooray!!). now, VB6 has a problem: I'm creating a data enviroment, and in the properties of the Connection (where you set which driver to use, user name, password, etc..) I'm getting an error when I test the connection. here is the error message:

    Test connection failed because of an error in initializing provider. [MySQL][ODBC 3.51 Driver]Table 'test.test' doesn't exist.

    now, I'm trying to connect to the default 'test' db provided by MySQL(yes, I did remember to add a table (testtable) and some records to the db). however, I don't know where this 'test.test' table is coming from.

    does anyone have any suggestions???

    ps - jonathan, thanks for your help from before!


  • JonathanJonathan Member Posts: 2,914
    : [b][red]This message was edited by LAbluesman at 2003-12-1 9:45:32[/red][/b][hr]
    : : : ok, so, then I guess my question should be this:
    : : : is there anything that I should/need to do on the server side to get
    : : : the computer with the MyODBC client and the server to talk to one
    : : : another?
    : : I actually think your question should be "The client and the server! They won't talk to each other! It's the same problem you have with that girl you like, Jonathan!"...
    : :
    : : I can surely give you a checklist, which you might wanna run through. With any luck, one of these might be the problem:-
    : :
    : : 1) Is the MySQL server running? (!)
    : : 2) Is there a firewall stopping remote connections to it?
    : : 3) Does the user you're trying to connect as have privileges set so you can connect from a remote system? You can make it so a user cannot login remotely, which isn't too helpful in this particular case. :-)
    : : 4) Correct username and password? No, quit laughing. I've spent an hour playing with settings on an ADSL router 'cus it refused to connect. It turned out we'd got all the other settings perfect first time, but typo'd the password. We were so sure that wouldn't be it that nobody checked!
    : : 5) Can you connect to the MySQL server locally (e.g. on the server it's hosted on)?
    : : 6) Have you posted any error messages you get on this forum? No, which means you either don't get any (plausible) or you don't realise how useful I'd find them in trying to find what's up. :-)
    : :
    : : Hope this helps,
    : :
    : : Jonathan
    : :
    :
    : **UPDATE**
    : ok,.. I'm a moron-monkey..
    :
    : everything is working just fine. the whole 'test.test' thing had to deal with the full naming of the database and a specific table. for those who aren't going "aaaahhh..", this means '.". so, in my case, there was no 'test' table in the database(my sql statement was : SELECT * FROM test). I should have used SELECT * FROM testtable - hence, 'test.testtable', which is correct.
    :
    : so, now that things are working just fine, I'll try to post up all the steps that are required for getting VB6 and MySQL to talk to eachother, for everyone else to use (and hopefully avoid the mistakes I've hit).
    :
    : **PREVIOUS MESSAGE**
    : it's me again,.. I didn't know if editing the previous post (again) would signal something current had occured in the thread, so, this new response should fit the bill!
    :
    : ok,.. the ODBC entry in the ODBC administrator is successfully talking to the MySQL DB (hooray!!). now, VB6 has a problem: I'm creating a data enviroment, and in the properties of the Connection (where you set which driver to use, user name, password, etc..) I'm getting an error when I test the connection. here is the error message:
    :
    : Test connection failed because of an error in initializing provider. [MySQL][ODBC 3.51 Driver]Table 'test.test' doesn't exist.
    :
    : now, I'm trying to connect to the default 'test' db provided by MySQL(yes, I did remember to add a table (testtable) and some records to the db). however, I don't know where this 'test.test' table is coming from.
    :
    : does anyone have any suggestions???
    :
    : ps - jonathan, thanks for your help from before!
    :

    Pleased you got it figured. I got busy, then sick, thus why I didn't get round to replying to your last question. A tutorial on doing VB6/MySQL would be really cool as a lot of people ask about it. Can I suggest you maybe put it in the CodePedia (http://www.codepedia.org/)?

    Thanks,

    Jonathan

    ###
    for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
    (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
    /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

  • LAbluesmanLAbluesman Member Posts: 14

    : Pleased you got it figured. I got busy, then sick, thus why I didn't get round to replying to your last question. A tutorial on doing VB6/MySQL would be really cool as a lot of people ask about it. Can I suggest you maybe put it in the CodePedia (http://www.codepedia.org/)?
    :
    : Thanks,
    :
    : Jonathan
    :
    hey jonathan,
    I haven't posted the solution in codepedia.com yet because I'm not sure it's working correctly. VB6 ~is~ connecting to the MySQL database, but, the VB6 recordset functions are not working properly. ie: the .Open() does open a connection to the database, but it appears to always be empty, even with a "SELECT * FROM " query.

    if anyone has encountered this before, or has any ideas, please post them here.

    when I find what works, I'll include it in the "VB6 and MySQL" write-up for codepedia.

    thanks in advance,
    -beau
Sign In or Register to comment.