用dao不能连接用Access2000健的数据库吗?

miame 2001-08-27 10:06:41
我用dao连Access97健的库一点问题都没有。但是换了Access2000建得库却提示不可识别的数据格式,请问用dao不能连接用Access2000健的数据库吗?
我很着急呀。知到的大虾告知好吗?
其实我就是想从数据库中检索出一些表出来,目前我只知道用dao连接后,用一下代码实现
dim dbfcl as dao.database
Set dbfCl = DBEngine.Workspaces(0).OpenDatabase(Cl_Path)
For Each tbfTable In dbfCl.TableDefs
ListTable.AddItem tbfTable.Name
Next
不知道用ado连接怎么个检索出表来。
谢谢各位了。
...全文
108 点赞 收藏 5
写回复
5 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
icewindsword 2001-09-27
写在initinstance 中
afxgetmodulestate()->m_dwversion = 0x0601;
回复
siyuan79 2001-08-28
应该是可以的啊!
回复
pengcheng 2001-08-28
肯定能连接,我作过。
用select语句检索。
回复
蒋晟 2001-08-28
FIX: Unrecognized Database Format Error with Data Control or Data Form Wizard
ID: Q257780


--------------------------------------------------------------------------------
The information in this article applies to:

Microsoft Visual Basic Professional and Enterprise Editions for Windows, version 6.0

--------------------------------------------------------------------------------


SYMPTOMS
When you attempt to connect to a Microsoft Access 2000 database by using either the standard Data control or the Data Form Wizard, you see the following error message where '...\databasename.mdb' is the absolute filename of the Access 2000 database:

Unrecognized database format '...\databasename.mdb'"



CAUSE
The standard Data control uses Data Access Object (DAO) 3.51 to connect to Access databases by using the Jet 3.51 engine.

The Data Form Wizard uses the Jet 3.51 OLE DB Provider to connect to Access databases by using the Jet 3.51 engine.

The Jet 3.51 engine can connect to Access database versions prior to Access 2000, but cannot connect to Access 2000 databases.



RESOLUTION
These problems are not seen with the Data control and Data Form Wizard that come with Microsoft Visual Studio 6.0 Service Pack 4.

Prior to service pack 4 for Visual Studio 6.0, the workaround for the standard Data control problem was to open a Recordset using DAO code, and then assign it to the Data control's Recordset. This workaround is described in Microsoft Knowledge Base article Q238401 in the "References" section.

Prior to service pack 4 for Visual Studio 6.0, the workarounds for the Data Form Wizard problem were:

Open the Access database through an ODBC DSN that uses the Access ODBC driver version 4.0.


Build the form manually using Jet 4.0 to connect to the database.


See these workarounds in the Microsoft Knowledge Base article Q242010 in the "References" section.

NOTE: There are known issues when connecting to Access 2000 on certain localized versions of Visual Basic 6.0 Service Pack 4. This is scheduled to be fixed in Visual Basic 6.0 Service Pack 5. However, this bug is fixed for the English version (North America) of Visual Basic 6.0 Service Pack 4.



STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug was corrected in Visual Studio 6.0 Service Pack 4.

For additional information about Visual Studio service packs, click the article numbers below to view the articles in the Microsoft Knowledge Base:

Q258648 INFO: Visual Studio 6.0 Service Pack 4, What, Where, Why
Q258649 HOWTO: Tell That Visual Studio 6.0 Service Pack 4 Is Installed
You can download Visual Studio Service Pack 4 from the following Microsoft Web site:
Visual Studio Product Updates



MORE INFORMATION

Steps to Reproduce Using the Standard Data Control
In Visual Basic, create a new Standard EXE project. Project1 is created by default. Form1 is added by default.


Place a Data control onto Form1. Data1 is created by default.


Set the DatabaseName property of the Data control to an Access 2000 database.


Attempt to set the RecordSource property of the Data control by clicking the drop-down list, and note that the error message in the "Symptoms" section appears.


Steps to Reproduce Using the Data Form Wizard
In Visual Basic, create a new Standard EXE project. Project1 is created by default. Form1 is added by default.


If the Data Form Wizard is not listed in Add-Ins menu, do the following:


From the Add-Ins menu, select Add-In Manager.


In the list of Available Add-Ins, select Data Form Wizard.


Click to check the Loaded/Unloaded checkbox.


Click OK, and note that the Data Form Wizard is now on the Add-Ins menu.


From the Add-Ins menu, select Data Form Wizard.


At the Introduction screen, click Next.


At the Database Type screen, select Access, and then click Next.


On the Database screen, click Browse, navigate to your Access database, and then click Open. When you click Next, the error message in the "Symptoms" section is displayed.





REFERENCES

Q238401 PRB: Unrecognized Database Format Error Upgrading to Access 2000
Q242010 PRB:The Data Form Wizard May Not Open an Access 2000 Database

Additional query words: sp4

Keywords : kbCtrl kbDatabase kbDataBinding kbJET kbMDAC kbVBp600bug kbGrpVBDB kbGrpMDAC kbDSupport kbDAO360 kbMDAC250 kbVS600sp4fix
Version : WINDOWS:6.0
Platform : WINDOWS
Issue type : kbbug
Technology :


Last Reviewed: August 30, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.




--------------------------------------------------------------------------------
Send feedback to MSDN.Look here for MSDN Online resources.
回复
Tomhankscn 2001-08-28
你可能用的是DAO3.51,DAO3.51是用不了Access2000的
试着用一用Microsoft DAO 3.60,应该没问题。





回复
发帖

1188

社区成员

VB 数据库(包含打印,安装,报表)
申请成为版主
帖子事件
创建了帖子
2001-08-27 10:06
社区公告
暂无公告