Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

vb(voice) connecting to mysql, ODBC driver etc

Options
  • 26-03-2008 10:52pm
    #1
    Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,098 Mod ✭✭✭✭


    Has anybody any experience connecting vbvoice to mysql?

    I have gotten the ODBC driver ala these websites instructions
    http://support.yessoftware.com/kb_article.asp?article_id=50
    http://ykfp.org/ODBC/
    and configured it with the database I want to use.

    I now want to make an application that connects to my database in vbvoice. However I'm not sure how I do this and have attached the first of my problems. :)

    In an example for vbvoice they have entered this into the box but they are not using MySQL. They link to a .mdb(microsoft database) but mysql obviously won't store things like that.
    ODBC;DBQ=C:\Program Files\Pronexus\VBVoice\examples\VB6Examples\CallerID2\caller.mdb;DefaultDir=C:\Program Files\Pronexus\VBVoice\examples\VB6Examples\CallerID2;Driver={Driver do Microsoft Access (*.mdb)};DriverId=281;FIL=MS Access;FILEDSN=C:\Documents and Settings\paulb\Desktop\test.dsn;MaxBufferSize=2048;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UID=admin;UserCommitSync=Yes;
    

    Is it something like:
    "Provider=MSDASQL; DRIVER={MySQL ODBC 3.51Driver}; SERVER= localhost; DATABASE=Your_MySQL_Database; UID= Your_Username; PASSWORD=Your_Password; OPTION=3"


Comments

  • Registered Users Posts: 2,931 ✭✭✭Ginger


    Create an ODBC connection to the database..

    Create it as a System DSN.

    So Control Panel -> Admin Tools -> ODBC Connections (Data Sources)

    Click System DSN

    Click Add

    Choose your driver, yours will be the MySQL one..

    Follow on screen instructions.

    Once its added and you have named it, just use that name in your connection.


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,098 Mod ✭✭✭✭Tar.Aldarion


    I did all that stuff yeah yesterday, thanks.
    I called it MySQLDataSource. So I just put that in.
    Do I not link to it somehow, I get an error with just the name(cannot connect to database)?
    (It connects in the ODBC thing in the the control panel fine)


    Anyhow, when I click on the 'use this table' field in the attached screenshot above. It says 'Enter DSN Name:'
    'select the file data sourse that describes the driver that you wish to connect to. You can use any file data source thbat refers to an ODBC driver which is installed on your machine'.

    Here was me thinking that I was just meant to select a table in the database...?


    Thanks mate.


  • Registered Users Posts: 2,931 ✭✭✭Ginger


    Did you create it as a System DSN??? does it find other ones on your system..


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,098 Mod ✭✭✭✭Tar.Aldarion


    Whoops, made it a user DSN. Thank you. Will see if that works. :)


  • Registered Users Posts: 2,931 ✭✭✭Ginger


    Ahh its looking for a file dsn...

    Same procedure.. just create it as a file and to be on the safe side save it somewhere you can find it.. i would expect that the dropdown is probably searching its local directory


  • Advertisement
  • Registered Users Posts: 2,931 ✭✭✭Ginger


    I did all that stuff yeah yesterday, thanks.
    I called it MySQLDataSource. So I just put that in.
    Do I not link to it somehow, I get an error with just the name(cannot connect to database)?
    (It connects in the ODBC thing in the the control panel fine)


    Anyhow, when I click on the 'use this table' field in the attached screenshot above. It says 'Enter DSN Name:'
    'select the file data sourse that describes the driver that you wish to connect to. You can use any file data source thbat refers to an ODBC driver which is installed on your machine'.

    Here was me thinking that I was just meant to select a table in the database...?


    Thanks mate.

    Right create a new file DSN and use that .. same as the system dsn style..

    Basically a file DSN is the same your connection string above.. if you open it in Notepad you will see what I am talking about


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,098 Mod ✭✭✭✭Tar.Aldarion


    Thanks, I don't even know what a DSN is!
    I'll try calling the file DSN the same thing as the system DSN and another one with some other name, don't know if it is meant to have the same name or not etc, or if it matters.

    EDIT: Thanks, it connects(just created a string like above as you said), shows the tables and fields etc. NOw a matter of learning how to use it in VBVoice.

    Cheers!


  • Registered Users Posts: 2,931 ✭✭✭Ginger


    A DSN is a Data Source name .. a shortcut for storing information for your database connection...

    Its nothing complicated..

    Instead of having a long connection string you say, use DSN=MyConnection for example..

    Also means that if you change the connection details in the DSN but not the name then any programs will use the new connection details...

    Very simple really


  • Registered Users Posts: 2,931 ✭✭✭Ginger


    Just delete the User and System DSNs and create the new file one with the connection details that you would normally use..

    Reason for the deletion is not to confuse you!

    Ahh it works.. then just the delete the system and user dsns


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,098 Mod ✭✭✭✭Tar.Aldarion


    Thanks, you've made made my morning.

    If you weren't in Norway I'd get you a pint. ;-)


  • Advertisement
  • Registered Users Posts: 2,931 ✭✭✭Ginger


    A pint in Norway is hella expensive! About 10€ so no worries on that front..

    Glad it works now.. nothing worse than banging your head against a wall trying to get it to work!


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,098 Mod ✭✭✭✭Tar.Aldarion


    Hello, I am getting another problem with this. When I try to update my MySQL database it says that it can not update the read-only database. Apparantly the file dsn is not getting the privileges right? I should be able to write to the database. Anybody know what to do? :/

    How can I let it know that it shoudl have write access?


  • Moderators, Science, Health & Environment Moderators, Social & Fun Moderators, Society & Culture Moderators Posts: 60,098 Mod ✭✭✭✭Tar.Aldarion


    Fixed it. What a day.


Advertisement