locked
Data Source with MySQL/ODBC RRS feed

  • Question

  • Hello, I am trying to add a Data Source with MySQL/ODBC 3.51.

    The connection to the MySQL DB is successful, however, VB uses a different SQL syntax than MySQL that throws an error every time I try to run a query.

    I found the syntax in the VB generated code that looks like this:

    Me._commandCollection(0).CommandText = "SELECT * FROM `cse_db`..`user`"

    The problem is the 'cse_db'..'user' portion. This is incompatible with MySQL syntax. How do I tell VB2005 to use a different SQL syntax?? Or, how do I tell MySQL to use VB2005 syntax?

    Any help will be greatly appreciated.

     

     

    Tuesday, January 3, 2006 3:25 PM

All replies

  • you can edit the sql string manually to fit your needs...

    typically surrounding the names with () will do the trick...

    Tuesday, January 3, 2006 3:28 PM
  • Thank you for your quick response. I have tried to modify the code, but I still get errors when using the Data Source controls (Ex. Whenever I 'Preview Data').

    Is there a way to make VB2005 SQL syntax more strict? Honestly, what is the purpose of the ".."?  Why not use the standard single "dot" operator?

    I would really like to make the Data Sources work just as well with MySQL as they do with SQLServer. The main reason I purchased this products was to make use of the GUI interface with Data Sources. Please let me know if this is possible.

     

    Thanks again. 

    Tuesday, January 3, 2006 7:47 PM