Newsgroup: it.comp.lang.visual-basic
Titolo: Opendatabase Access2000

Sul mio PC ho installato sia Access 97, sia Access 2000.
Via codice ho bisogno di aprire un DB di Access.
Se questo DB è fatto con Access 97, esegue correttamente l'istruzione Set
....=DBEngine.Opendatabase(...)
Se questo DB è fatto con Access 2000, all'esecuzione dell'istruzione di cui
sopra, non riconosce il formato del DB e genera l'errore 3343 (mi pare).
N.B. Da registro risco a trovare se ci sono e dove sono le varie versioni di
access, ma l'istruzione opendatabase è sempre la stessa...!!!
Qualche idea?
Mari



Usa DAO 3.6
Ciao,
Moreno
#sirri#@#morenosoft#.com
(togliete "#" dall'indirizzo)
Moreno Sirri VB Site - 
http://www.morenosoft.com/MSVBSite/
---------------------------------------------------------------------------
Le risposte alle tue domande le trovi sul Sito Comune di questo NewsGroup:
 
http://www.murialdo.it/it_lang_vb
---------------------------------------------------------------------------


Cioč??? :-((
Mari

Cioč??? :-((
MSDN dice:
---------- INIZIO ---------------
PRB: Getting Unrecognized Database Format Error Message When Upgrading to Access 2000 
--------------------------------------------------------------------------------
The information in this article applies to:
Microsoft Visual Basic Professional and Enterprise Editions for Windows, versions 5.0, 6.0 
Microsoft Access 2000
--------------------------------------------------------------------------------
SYMPTOMS
If you try to gain access to an Access 2000 database, you might experience one of the following
errors within your Visual Basic program: 
If you are using ADO (or the ADO Data Control): 
Run-time error -
2147467259
 Unrecognized Database Format XXX 
If you are using DAO (or the DAO generic Data Control): 
Run-time error 3343 Unrecognized Database Format XXX 
CAUSE
Access 2000 uses the Jet 4.0 engine, which creates Jet 4.0 format database files. Jet 3.50
components would not recognize such a format.
If you are using ADO, you get error -
2147467259
 when you try to connect to your Access 2000 through
the "Microsoft.Jet.OLEDB.3.51" provider. 
If you are using DAO, you get error 3343 above when you use the "Microsoft DAO 3.51 Object Library."
The DAO generic Data-Control does not work against Access 2000 databases, and always generates error
3343 unless used as instructed in the RESOLUTION section of this article. This occurs because this
control is based on Jet 3.51 and only recognizes Jet 3.51 (or before) database formats. 
RESOLUTION
For ADO (or the ADO Data Control), use the "Microsoft.Jet.OLEDB.4.0" provider. 
For DAO, go to Project menu, and choose References to use the "Microsoft DAO 3.6 Object Library." 
If you use the generic Data-Control, you need to open a DAO 3.6 recordset and then assign it to be
the source of the Data Control as follows: 
Option Explicit
Private daoDB36 As Database
Private rs As DAO.Recordset
Dim sPath As String
Private Sub Form_Load()
sPath = _
"C:\Program Files\Microsoft Office\Office\Samples\Northwind.mdb"
Set daoDB36 = DBEngine(0).OpenDatabase(sPath)
Set rs = daoDB36.OpenRecordset("Customers")
Set Data1.Recordset = rs
End Sub 
STATUS
This behavior is by design. 
REFERENCES
For more information on Jet 4.0, refer to the Access 2000 documentation.
For more information on ADO and DAO, refer to the Visual Basic documentation.
For more information on "Unrecognized Database Format," query on this in the MSDN Library supplied
with Visual Basic.
Š Microsoft Corporation 1999, All Rights Reserved.
Contributions by Ammar Abuthuraya, Microsoft Corporation
Additional query words: 
Keywords : kbtophit kbAccess kbADO kbCtrl kbDAO kbJET kbOLEDB kbVBp500 kbVBp600 kbGrpMDAC 
Version : WINDOWS:2000,5.0,6.0 
Platform : WINDOWS 
Issue type : kbprb 
Technology : 
Last Reviewed: June 28, 2000
Š 2000 Microsoft Corporation. All rights reserved. Terms of Use.
 
--------------------------------------------------------------------------------
Send feedback to MSDN.Look here for MSDN Online resources. 
------------ FINE --------------------
