I'm working on VS2005 and have tried using MySQL's ODBC to connect to a database.
我正在研究VS2005,并尝试使用MySQL的ODBC连接到数据库。
The problem is that when I get to the part of choosing which tables to use, there are no tables and the only selectable thing is a View, which has no name and is null (of course something like this doesn't really exist in the DB). I tried adding a Table adapter using SQL statements, which apparently works perfectly (tried also adding a Datagridview to make sure it's not a mirage and it worked perfectly) if I type the whole thing, but in the query builder it doesn't show me any tables to choose from (again if I type the name of the table, it appears but it still doesn't show it's columns). Also if I select the "Views" Tab, I get the following message:
问题是,当我选择使用哪些表时,没有表,唯一可选择的是View,它没有名称而且是null(当然这样的东西并不存在D B)。我尝试使用SQL语句添加一个表适配器,它显然工作得很好(尝试添加一个Datagridview以确保它不是海市蜃楼并且它工作得很好)如果我输入整个东西,但在查询构建器中它没有显示我任何可供选择的表(如果我输入表的名称,它会出现,但它仍然没有显示它的列)。此外,如果我选择“视图”选项卡,我会收到以下消息:
The query builder failed
查询构建器失败
Attempt to read or write protected memory. This is often an indication that other memory is corrupt.
尝试读取或写入受保护的内存。这通常表明其他内存已损坏。
If it wouldn't work using the hand typed SQL statements, I may have believed it, but apparently that is not the problem. So my question is: What is going on here? Anyone has ever heard of an issue like this? And even more important: Does anyone know how to fix this?
如果它不能使用手工输入的SQL语句,我可能已经相信它,但显然这不是问题。所以我的问题是:这里发生了什么?有没有人听说过像这样的问题?更重要的是:有谁知道如何解决这个问题?
1 个解决方案
#1
You should enable ODBC logging and check out the log
您应该启用ODBC日志记录并签出日志
alt text http://img142.imageshack.us/img142/1667/20090727225415.png
替代文字http://img142.imageshack.us/img142/1667/20090727225415.png
And you might find useful odbctest utility http://msdn.microsoft.com/en-us/library/ms712676%28VS.85%29.aspx It is installed with MDAC or can be downloaded from http://www.datadirect.com/support/downloads/tools/index.ssp
您可能会发现有用的odbctest实用程序http://msdn.microsoft.com/en-us/library/ms712676%28VS.85%29.aspx它与MDAC一起安装或可以从http://www.datadirect下载。 COM /支持/下载/工具/ index.ssp
#1
You should enable ODBC logging and check out the log
您应该启用ODBC日志记录并签出日志
alt text http://img142.imageshack.us/img142/1667/20090727225415.png
替代文字http://img142.imageshack.us/img142/1667/20090727225415.png
And you might find useful odbctest utility http://msdn.microsoft.com/en-us/library/ms712676%28VS.85%29.aspx It is installed with MDAC or can be downloaded from http://www.datadirect.com/support/downloads/tools/index.ssp
您可能会发现有用的odbctest实用程序http://msdn.microsoft.com/en-us/library/ms712676%28VS.85%29.aspx它与MDAC一起安装或可以从http://www.datadirect下载。 COM /支持/下载/工具/ index.ssp