Access Database corrupted

  • Thread starter Thread starter Sebastien Lange
  • Start date Start date
S

Sebastien Lange

Hi,

It seems not possible to repair an access DB programmatically with ADO.NET.
JRO only compact it, without repairing.
The only way seems to use MS Office PIAs.
My customers have Access 97. Is there PIAs for 97? I suppose no! Only for XP
& 2003, isn't it?
Then the only possiblity seems to launch Access 97 with my mdb as
argument... and ask the customer to do it himself? any other idea??? Or
create a com dll that reference Access 97 and then try to repair it?
Any idea?

Thanks,
Sebastien
 
I don't think Access 97 is even supported any more and I'm sure
there's no PIA for it. You can always create a shortcut for your
customer to compact and repair his database, and place it on his
desktop. I forget the exact syntax, but it will be in online help
under command line switches, or some such.

-- Mary
MCW Technologies
http://www.mcwtech.com
 
What is JRO? I need to be able to compact an Access db. It sounds like you

know how to do it. Can you explain it to me?

Don
 
You should be able to use automation and do it.

You can also spawn your own command line and do a compact/repair from there

"accesspath\access.exe" "databasepath\databasename" \repair

I Think that is the command.

Using automation you have to compact/repair it into another database and do
a rename. This can actually be safer since you can recover from a system
crash if it happens while the repair is in progress (seldom but worth a
thought or two).

HTH

Ken
 
Thanks,

The mdb format is Access 97 and /repair is working fine if the user has ms
access 97.
If he has another version (2000, XP or 2003), the db is repaired AND
converted to access 2000.
Arg... Is there a way to re-convert it to 97? I know I can manually with Ms
Access, but I need a programmatic solution. /convert only converts to 2000.

Sebastien
 
Hi Sebastien,

We can programmatically convert the Access 2000/2002 format to Access 97 by
using the Access object library. The following is the article, please test
the method to see if it works for you:


Q304318 ACC2002: Programmatically Convert Multiple Access Databases
http://support.microsoft.com/support/kb/articles/q304/3/18.asp

The /convert switch cannot detect the DefaultDatabaseFormat property. In
Access 2002, the switch can convert the database only into Access 2000 file
format.


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

- Microsoft Access 2002

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



Advanced: Requires expert coding, interoperability, and multiuser skills.



This article applies only to a Microsoft Access database (.mdb).




SUMMARY
=======


This article shows you two methods that you can use to programmatically
convert Microsoft Access databases. The first method uses the
ConvertAccessProject method to convert databases to the format that you
specify. The second method uses the Shell function to run Msaccess.exe with
the /convert switch. This second method is embedded in a comment block in
the sample code. When you use the second method, the databases will be
converted to Access 2000 file format regardless of the Default File Format
that is specified in the Options dialog box on the Tools menu.


MORE INFORMATION
================

Microsoft provides programming examples for illustration only, without
warranty either
expressed or implied, including, but not limited to, the implied warranties
of
merchantability and/or fitness for a particular purpose. This article
assumes
that you are familiar with the programming language being demonstrated and
the
tools used to create and debug procedures. Microsoft support professionals
can
help explain the functionality of a particular procedure, but they will not
modify these examples to provide added functionality or construct
procedures to
meet your specific needs. If you have limited programming experience, you
may
want to contact a Microsoft Certified Partner or the Microsoft fee-based
consulting line at (800) 936-5200. For more information about Microsoft
Certified
Partners, please visit the following Microsoft Web site:



http://www.microsoft.com/partner/referral/



For more information about the support options that are available and about
how to contact Microsoft, visit the following Microsoft Web site:



http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS

1. Open a new or an existing database.

2. On the Insert menu, click Module. Type the following line in the
Declarations section if it is not already there:


Option Explicit


3. Type or paste the following procedure:


Sub ConvertDb(oldDbPath As String, newDbPath As String)

'NOTE: Uncomment the line Dim x if you are using the
'alternative Shell function method listed later in this code.

'Dim x

Dim strDBName As String
Dim strOLDDB As String
Dim strNewDb As String

strDBName = Dir(oldDbPath & "\*.MDB") ' Retrieve the first MDB file
entry.

'Loop though the files in the folder to find MDB files.

Do While strDBName <> ""
' Ignore the current folder and the encompassing folder.
If strDBName <> "." And strDBName <> ".." Then

If Right(strDBName, 3) = "mdb" Then
strOLDDB = oldDbPath & "\" & strDBName
strNewDb = newDbPath & "\" & strDBName

'NOTE: Comment out the following four lines if you are using the
'Shell function method.

Application.ConvertAccessProject _
SourceFilename:=strOLDDB, _
DestinationFilename:=strNewDb, _
DestinationFileFormat:=acFileFormatAccess2000

'NOTE: The alternative method is to use the Shell function to open
'Access and concatenate the Convert switch instead of using the
'ConvertAccessProject method. To use this method, uncomment the
'following two lines.

' x = Shell("C:\Program Files\Microsoft
Office\Office10\MSACCESS.EXE " & Chr(34) _
' & strOLDDB & Chr(34) & " /Convert " & Chr(34) & strNewDb &
Chr(34))

MsgBox "Conversion complete."
End If
End If
strDBName = Dir ' Get next MDB.
Loop

End Sub




4. To test this function, create two folders in the root directory of drive
C. Name the folders "DatabasesToConvert" (without the quotation marks) and
"ConvertedDatabases" (without the quotation marks). Put the databases that
you want to convert in the DatabasesToConvert folder, type the following
line in the Immediate window, and then press ENTER:



call ConvertDb("C:\DatabasesToConvert", "C:\ConvertedDatabases")



REFERENCES
==========

For more information about the ConvertAccessProject method, in the Visual
Basic Editor, click Microsoft Visual Basic Help on the Help menu, type
convertaccessproject in the Office Assistant or the Answer Wizard, and then
click Search to view the topic.


For additional information about database conversion, click the article
number below
to view the article in the Microsoft Knowledge Base:



KBLink:319400.KB.EN-US: ACC2002: Conversion White Paper Available in
the Download Center




Sincerely,

Kevin
Microsoft Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! - www.microsoft.com/security

--------------------
| From: "Sebastien Lange" <[email protected]>
| References: <[email protected]>
<[email protected]>
| Subject: Re: Access Database corrupted
| Date: Fri, 10 Oct 2003 08:18:19 +0200
| Lines: 37
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| NNTP-Posting-Host: alc243.alcatel.be 195.207.101.243
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:63347
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| See http://support.microsoft.com/default.aspx?scid=kb;en-us;306287
|
|
|
| | > What is JRO? I need to be able to compact an Access db. It sounds like
you
| >
| > know how to do it. Can you explain it to me?
| >
| > Don
| >
| > | > > Hi,
| > >
| > > It seems not possible to repair an access DB programmatically with
| > ADO.NET.
| > > JRO only compact it, without repairing.
| > > The only way seems to use MS Office PIAs.
| > > My customers have Access 97. Is there PIAs for 97? I suppose no! Only
| for
| > XP
| > > & 2003, isn't it?
| > > Then the only possiblity seems to launch Access 97 with my mdb as
| > > argument... and ask the customer to do it himself? any other idea???
Or
| > > create a com dll that reference Access 97 and then try to repair it?
| > > Any idea?
| > >
| > > Thanks,
| > > Sebastien
| > >
| > >
| >
| >
|
|
|
 
Thanks Kevin,

This solution works fine if all my customers have the same Access version,
so I can reference in the conversion library the good Access object library.
But I don't know which version they have. It can be 97, 2000, XP or 2003.
If it is 97, no conversion needed. For others, I should references the 3
object libraries (Microsoft Access 11.0 Object Library, 10.0 and 9.0), isn't
it? but I don't think I can!!!

Sebastien
 
I was assuming that your customers had Access 97 on their computers.

If they have multiple versions of Access, the accesspath should point to
access 97 version (runtime or full). Then it will not convert it to a later
version of Access. I do this all the time.

I use WISE installer with SAGEKey to install runtime versions of Access 97
onto a system. Never had a problem with it. But, you must specify which
msAccess.exe file is to be used, otherwise it uses a default (in some cases
the last one opened, others the latest version).

HTH

Ken
 
Ken,

In fact they don't have multiple versions, but just one of them. And if it's
97, that's ok, otherwise not. Unfortunately I can't convert it to 2000 or
later, other applications of the system need 97 file format.

Sebastien
 
is it the back end that needs compacting? I would do it on a scheduler when
no one is using it.

or the front end? If it is the front end I solved the problem with a simple
"Performance Enhancement" button. All it did was to copy from the network a
compacted version of the front end. Solved a lot of problems for the
customer (and me). When ever things seemed slow, the user would Enhance
their performance. It also made a way to distribute updates.

If you are compacting because of temporary table useage, I would suggest
putting the temp tables in a tempdatabase. Delete this database (one per
user) everytime the app opens and recreate it. It is faster than compacting.
use the createfield/createtable functions in access.

I hope these ideas may be of use,

HTH
Ken
 
That's not compacting... but repairing! Database corrupted...
Anyway, thank you for your answers.
In fact a solution would be to recreate the db and copy each table from 2000
to 97... but it will be slow...

Sebastien
 
Hi Sebastien,

Yes, this is an issue. You could create three different version of the
application. And run the application based on the version of Access on the
user's machine.

[More Information]:

317113.KB.EN-US HOW TO: Automate Microsoft Access From Visual Basic .NET
http://support.microsoft.com/default.aspx?scid=KB;EN-US;317113


Please let me know if this helps in solving your issue.



Sincerely,

Kevin
Microsoft Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! - www.microsoft.com/security

--------------------
| From: "Sebastien Lange" <[email protected]>
| References: <[email protected]>
<[email protected]>
<#[email protected]>
<[email protected]>
| Subject: Re: Access Database corrupted
| Date: Fri, 10 Oct 2003 12:01:44 +0200
| Lines: 283
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| NNTP-Posting-Host: alc243.alcatel.be 195.207.101.243
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:63357
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| Thanks Kevin,
|
| This solution works fine if all my customers have the same Access version,
| so I can reference in the conversion library the good Access object
library.
| But I don't know which version they have. It can be 97, 2000, XP or 2003.
| If it is 97, no conversion needed. For others, I should references the 3
| object libraries (Microsoft Access 11.0 Object Library, 10.0 and 9.0),
isn't
| it? but I don't think I can!!!
|
| Sebastien
|
| | > Hi Sebastien,
| >
| > We can programmatically convert the Access 2000/2002 format to Access 97
| by
| > using the Access object library. The following is the article, please
test
| > the method to see if it works for you:
| >
| >
| > Q304318 ACC2002: Programmatically Convert Multiple Access Databases
| > http://support.microsoft.com/support/kb/articles/q304/3/18.asp
| >
| > The /convert switch cannot detect the DefaultDatabaseFormat property. In
| > Access 2002, the switch can convert the database only into Access 2000
| file
| > format.
| >
| >
| >
|
============================================================================
| > ===
| >
--------------------------------------------------------------------------
| --
| > ---
| > The information in this article applies to:
| >
| > - Microsoft Access 2002
| >
| >
--------------------------------------------------------------------------
| --
| > ---
| >
| >
| >
| > Advanced: Requires expert coding, interoperability, and multiuser
skills.
| >
| >
| >
| > This article applies only to a Microsoft Access database (.mdb).
| >
| >
| >
| >
| > SUMMARY
| > =======
| >
| >
| > This article shows you two methods that you can use to programmatically
| > convert Microsoft Access databases. The first method uses the
| > ConvertAccessProject method to convert databases to the format that you
| > specify. The second method uses the Shell function to run Msaccess.exe
| with
| > the /convert switch. This second method is embedded in a comment block
in
| > the sample code. When you use the second method, the databases will be
| > converted to Access 2000 file format regardless of the Default File
Format
| > that is specified in the Options dialog box on the Tools menu.
| >
| >
| > MORE INFORMATION
| > ================
| >
| > Microsoft provides programming examples for illustration only, without
| > warranty either
| > expressed or implied, including, but not limited to, the implied
| warranties
| > of
| > merchantability and/or fitness for a particular purpose. This article
| > assumes
| > that you are familiar with the programming language being demonstrated
and
| > the
| > tools used to create and debug procedures. Microsoft support
professionals
| > can
| > help explain the functionality of a particular procedure, but they will
| not
| > modify these examples to provide added functionality or construct
| > procedures to
| > meet your specific needs. If you have limited programming experience,
you
| > may
| > want to contact a Microsoft Certified Partner or the Microsoft fee-based
| > consulting line at (800) 936-5200. For more information about Microsoft
| > Certified
| > Partners, please visit the following Microsoft Web site:
| >
| >
| >
| > http://www.microsoft.com/partner/referral/
| >
| >
| >
| > For more information about the support options that are available and
| about
| > how to contact Microsoft, visit the following Microsoft Web site:
| >
| >
| >
| > http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS
| >
| > 1. Open a new or an existing database.
| >
| > 2. On the Insert menu, click Module. Type the following line in the
| > Declarations section if it is not already there:
| >
| >
| > Option Explicit
| >
| >
| > 3. Type or paste the following procedure:
| >
| >
| > Sub ConvertDb(oldDbPath As String, newDbPath As String)
| >
| > 'NOTE: Uncomment the line Dim x if you are using the
| > 'alternative Shell function method listed later in this code.
| >
| > 'Dim x
| >
| > Dim strDBName As String
| > Dim strOLDDB As String
| > Dim strNewDb As String
| >
| > strDBName = Dir(oldDbPath & "\*.MDB") ' Retrieve the first MDB file
| > entry.
| >
| > 'Loop though the files in the folder to find MDB files.
| >
| > Do While strDBName <> ""
| > ' Ignore the current folder and the encompassing folder.
| > If strDBName <> "." And strDBName <> ".." Then
| >
| > If Right(strDBName, 3) = "mdb" Then
| > strOLDDB = oldDbPath & "\" & strDBName
| > strNewDb = newDbPath & "\" & strDBName
| >
| > 'NOTE: Comment out the following four lines if you are using the
| > 'Shell function method.
| >
| > Application.ConvertAccessProject _
| > SourceFilename:=strOLDDB, _
| > DestinationFilename:=strNewDb, _
| > DestinationFileFormat:=acFileFormatAccess2000
| >
| > 'NOTE: The alternative method is to use the Shell function to
open
| > 'Access and concatenate the Convert switch instead of using the
| > 'ConvertAccessProject method. To use this method, uncomment the
| > 'following two lines.
| >
| > ' x = Shell("C:\Program Files\Microsoft
| > Office\Office10\MSACCESS.EXE " & Chr(34) _
| > ' & strOLDDB & Chr(34) & " /Convert " & Chr(34) & strNewDb &
| > Chr(34))
| >
| > MsgBox "Conversion complete."
| > End If
| > End If
| > strDBName = Dir ' Get next MDB.
| > Loop
| >
| > End Sub
| >
| >
| >
| >
| > 4. To test this function, create two folders in the root directory of
| drive
| > C. Name the folders "DatabasesToConvert" (without the quotation marks)
| and
| > "ConvertedDatabases" (without the quotation marks). Put the databases
| that
| > you want to convert in the DatabasesToConvert folder, type the following
| > line in the Immediate window, and then press ENTER:
| >
| >
| >
| > call ConvertDb("C:\DatabasesToConvert", "C:\ConvertedDatabases")
| >
| >
| >
| > REFERENCES
| > ==========
| >
| > For more information about the ConvertAccessProject method, in the
Visual
| > Basic Editor, click Microsoft Visual Basic Help on the Help menu, type
| > convertaccessproject in the Office Assistant or the Answer Wizard, and
| then
| > click Search to view the topic.
| >
| >
| > For additional information about database conversion, click the article
| > number below
| > to view the article in the Microsoft Knowledge Base:
| >
| >
| >
| > KBLink:319400.KB.EN-US: ACC2002: Conversion White Paper Available in
| > the Download Center
| >
| >
| >
| >
| > Sincerely,
| >
| > Kevin
| > Microsoft Support
| >
| > This posting is provided "AS IS" with no warranties, and confers no
| rights.
| > Get Secure! - www.microsoft.com/security
| >
| > --------------------
| > | From: "Sebastien Lange" <[email protected]>
| > | References: <[email protected]>
| > <[email protected]>
| > | Subject: Re: Access Database corrupted
| > | Date: Fri, 10 Oct 2003 08:18:19 +0200
| > | Lines: 37
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <#[email protected]>
| > | Newsgroups: microsoft.public.dotnet.framework.adonet
| > | NNTP-Posting-Host: alc243.alcatel.be 195.207.101.243
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.framework.adonet:63347
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
| > |
| > | See http://support.microsoft.com/default.aspx?scid=kb;en-us;306287
| > |
| > |
| > |
| > | | > | > What is JRO? I need to be able to compact an Access db. It sounds
like
| > you
| > | >
| > | > know how to do it. Can you explain it to me?
| > | >
| > | > Don
| > | >
message
| > | > | > | > > Hi,
| > | > >
| > | > > It seems not possible to repair an access DB programmatically with
| > | > ADO.NET.
| > | > > JRO only compact it, without repairing.
| > | > > The only way seems to use MS Office PIAs.
| > | > > My customers have Access 97. Is there PIAs for 97? I suppose no!
| Only
| > | for
| > | > XP
| > | > > & 2003, isn't it?
| > | > > Then the only possiblity seems to launch Access 97 with my mdb as
| > | > > argument... and ask the customer to do it himself? any other
idea???
| > Or
| > | > > create a com dll that reference Access 97 and then try to repair
it?
| > | > > Any idea?
| > | > >
| > | > > Thanks,
| > | > > Sebastien
| > | > >
| > | > >
| > | >
| > | >
| > |
| > |
| > |
| >
|
|
|
 
I found 90% of the solution. If the user has Access XP or 2003 the following
code converts successfully from 2000 to 97:

Type accessType = Type.GetTypeFromProgID("Access.Application");
object accessApp = Activator.CreateInstance(accessType);
Console.WriteLine("Access version = " + accessType.InvokeMember("Version",
BindingFlags.GetProperty, null, accessApp, null).ToString());
accessType.InvokeMember("ConvertAccessProject", BindingFlags.InvokeMethod,
null, accessApp, new object[]{"my2Kdb.mdb", "my97db.mdb", 8});

But if the user has Access 2000, there is no ConvertAccessProject method...
Do you know any other way/method for Access 2000 users?

Sebastien

Kevin Sun said:
Hi Sebastien,

Yes, this is an issue. You could create three different version of the
application. And run the application based on the version of Access on the
user's machine.

[More Information]:

317113.KB.EN-US HOW TO: Automate Microsoft Access From Visual Basic .NET
http://support.microsoft.com/default.aspx?scid=KB;EN-US;317113


Please let me know if this helps in solving your issue.



Sincerely,

Kevin
Microsoft Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! - www.microsoft.com/security

--------------------
| From: "Sebastien Lange" <[email protected]>
| References: <[email protected]>
<[email protected]>
<#[email protected]>
<[email protected]>
| Subject: Re: Access Database corrupted
| Date: Fri, 10 Oct 2003 12:01:44 +0200
| Lines: 283
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| NNTP-Posting-Host: alc243.alcatel.be 195.207.101.243
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:63357
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| Thanks Kevin,
|
| This solution works fine if all my customers have the same Access version,
| so I can reference in the conversion library the good Access object
library.
| But I don't know which version they have. It can be 97, 2000, XP or 2003.
| If it is 97, no conversion needed. For others, I should references the 3
| object libraries (Microsoft Access 11.0 Object Library, 10.0 and 9.0),
isn't
| it? but I don't think I can!!!
|
| Sebastien
|
| | > Hi Sebastien,
| >
| > We can programmatically convert the Access 2000/2002 format to Access 97
| by
| > using the Access object library. The following is the article, please
test
| > the method to see if it works for you:
| >
| >
| > Q304318 ACC2002: Programmatically Convert Multiple Access Databases
| > http://support.microsoft.com/support/kb/articles/q304/3/18.asp
| >
| > The /convert switch cannot detect the DefaultDatabaseFormat property. In
| > Access 2002, the switch can convert the database only into Access 2000
| file
| > format.
| >
| >
| >
|
============================================================================
| > ===
| >
--------------------------------------------------------------------------
| --
| > ---
| > The information in this article applies to:
| >
| > - Microsoft Access 2002
| >
| >
--------------------------------------------------------------------------
| --
| > ---
| >
| >
| >
| > Advanced: Requires expert coding, interoperability, and multiuser
skills.
| >
| >
| >
| > This article applies only to a Microsoft Access database (.mdb).
| >
| >
| >
| >
| > SUMMARY
| > =======
| >
| >
| > This article shows you two methods that you can use to programmatically
| > convert Microsoft Access databases. The first method uses the
| > ConvertAccessProject method to convert databases to the format that you
| > specify. The second method uses the Shell function to run Msaccess.exe
| with
| > the /convert switch. This second method is embedded in a comment block
in
| > the sample code. When you use the second method, the databases will be
| > converted to Access 2000 file format regardless of the Default File
Format
| > that is specified in the Options dialog box on the Tools menu.
| >
| >
| > MORE INFORMATION
| > ================
| >
| > Microsoft provides programming examples for illustration only, without
| > warranty either
| > expressed or implied, including, but not limited to, the implied
| warranties
| > of
| > merchantability and/or fitness for a particular purpose. This article
| > assumes
| > that you are familiar with the programming language being demonstrated
and
| > the
| > tools used to create and debug procedures. Microsoft support
professionals
| > can
| > help explain the functionality of a particular procedure, but they will
| not
| > modify these examples to provide added functionality or construct
| > procedures to
| > meet your specific needs. If you have limited programming experience,
you
| > may
| > want to contact a Microsoft Certified Partner or the Microsoft fee-based
| > consulting line at (800) 936-5200. For more information about Microsoft
| > Certified
| > Partners, please visit the following Microsoft Web site:
| >
| >
| >
| > http://www.microsoft.com/partner/referral/
| >
| >
| >
| > For more information about the support options that are available and
| about
| > how to contact Microsoft, visit the following Microsoft Web site:
| >
| >
| >
| > http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS
| >
| > 1. Open a new or an existing database.
| >
| > 2. On the Insert menu, click Module. Type the following line in the
| > Declarations section if it is not already there:
| >
| >
| > Option Explicit
| >
| >
| > 3. Type or paste the following procedure:
| >
| >
| > Sub ConvertDb(oldDbPath As String, newDbPath As String)
| >
| > 'NOTE: Uncomment the line Dim x if you are using the
| > 'alternative Shell function method listed later in this code.
| >
| > 'Dim x
| >
| > Dim strDBName As String
| > Dim strOLDDB As String
| > Dim strNewDb As String
| >
| > strDBName = Dir(oldDbPath & "\*.MDB") ' Retrieve the first MDB file
| > entry.
| >
| > 'Loop though the files in the folder to find MDB files.
| >
| > Do While strDBName <> ""
| > ' Ignore the current folder and the encompassing folder.
| > If strDBName <> "." And strDBName <> ".." Then
| >
| > If Right(strDBName, 3) = "mdb" Then
| > strOLDDB = oldDbPath & "\" & strDBName
| > strNewDb = newDbPath & "\" & strDBName
| >
| > 'NOTE: Comment out the following four lines if you are using the
| > 'Shell function method.
| >
| > Application.ConvertAccessProject _
| > SourceFilename:=strOLDDB, _
| > DestinationFilename:=strNewDb, _
| > DestinationFileFormat:=acFileFormatAccess2000
| >
| > 'NOTE: The alternative method is to use the Shell function to
open
| > 'Access and concatenate the Convert switch instead of using the
| > 'ConvertAccessProject method. To use this method, uncomment the
| > 'following two lines.
| >
| > ' x = Shell("C:\Program Files\Microsoft
| > Office\Office10\MSACCESS.EXE " & Chr(34) _
| > ' & strOLDDB & Chr(34) & " /Convert " & Chr(34) & strNewDb &
| > Chr(34))
| >
| > MsgBox "Conversion complete."
| > End If
| > End If
| > strDBName = Dir ' Get next MDB.
| > Loop
| >
| > End Sub
| >
| >
| >
| >
| > 4. To test this function, create two folders in the root directory of
| drive
| > C. Name the folders "DatabasesToConvert" (without the quotation marks)
| and
| > "ConvertedDatabases" (without the quotation marks). Put the databases
| that
| > you want to convert in the DatabasesToConvert folder, type the following
| > line in the Immediate window, and then press ENTER:
| >
| >
| >
| > call ConvertDb("C:\DatabasesToConvert", "C:\ConvertedDatabases")
| >
| >
| >
| > REFERENCES
| > ==========
| >
| > For more information about the ConvertAccessProject method, in the
Visual
| > Basic Editor, click Microsoft Visual Basic Help on the Help menu, type
| > convertaccessproject in the Office Assistant or the Answer Wizard, and
| then
| > click Search to view the topic.
| >
| >
| > For additional information about database conversion, click the article
| > number below
| > to view the article in the Microsoft Knowledge Base:
| >
| >
| >
| > KBLink:319400.KB.EN-US: ACC2002: Conversion White Paper Available in
| > the Download Center
| >
| >
| >
| >
| > Sincerely,
| >
| > Kevin
| > Microsoft Support
| >
| > This posting is provided "AS IS" with no warranties, and confers no
| rights.
| > Get Secure! - www.microsoft.com/security
| >
| > --------------------
| > | From: "Sebastien Lange" <[email protected]>
| > | References: <[email protected]>
| > <[email protected]>
| > | Subject: Re: Access Database corrupted
| > | Date: Fri, 10 Oct 2003 08:18:19 +0200
| > | Lines: 37
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <#[email protected]>
| > | Newsgroups: microsoft.public.dotnet.framework.adonet
| > | NNTP-Posting-Host: alc243.alcatel.be 195.207.101.243
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.framework.adonet:63347
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
| > |
| > | See http://support.microsoft.com/default.aspx?scid=kb;en-us;306287
| > |
| > |
| > |
| > | | > | > What is JRO? I need to be able to compact an Access db. It sounds
like
| > you
| > | >
| > | > know how to do it. Can you explain it to me?
| > | >
| > | > Don
| > | >
message
| > | > | > | > > Hi,
| > | > >
| > | > > It seems not possible to repair an access DB programmatically with
| > | > ADO.NET.
| > | > > JRO only compact it, without repairing.
| > | > > The only way seems to use MS Office PIAs.
| > | > > My customers have Access 97. Is there PIAs for 97? I suppose no!
| Only
| > | for
| > | > XP
| > | > > & 2003, isn't it?
| > | > > Then the only possiblity seems to launch Access 97 with my mdb as
| > | > > argument... and ask the customer to do it himself? any other
idea???
| > Or
| > | > > create a com dll that reference Access 97 and then try to repair
it?
| > | > > Any idea?
| > | > >
| > | > > Thanks,
| > | > > Sebastien
| > | > >
| > | > >
| > | >
| > | >
| > |
| > |
| > |
| >
|
|
|
 
¤ Hi,
¤
¤ It seems not possible to repair an access DB programmatically with ADO.NET.
¤ JRO only compact it, without repairing.
¤ The only way seems to use MS Office PIAs.
¤ My customers have Access 97. Is there PIAs for 97? I suppose no! Only for XP
¤ & 2003, isn't it?
¤ Then the only possiblity seems to launch Access 97 with my mdb as
¤ argument... and ask the customer to do it himself? any other idea??? Or
¤ create a com dll that reference Access 97 and then try to repair it?
¤ Any idea?

You can still use DAO to repair the database without using the custom Office PIAs. VB.NET will
create a generic PIA when you add DAO to your project:

DBEngine.RepairDatabase dbname
DBEngine.CompactDatabase olddb, newdb, locale, options, password


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Paul,

RepairDatabase throws the following exception : "Operation is not supported
for this type of object."
Documentation states about this method:
"Note The RepairDatabase method is no longer available, but listed for
backwards compatibility. Use the CompactDatabase method instead."

So I tried with CompactDatabase and my db has been repaired, and is still in
the same access format!

Thanks a lot!
Sebastien

 
¤ Paul,
¤
¤ RepairDatabase throws the following exception : "Operation is not supported
¤ for this type of object."
¤ Documentation states about this method:
¤ "Note The RepairDatabase method is no longer available, but listed for
¤ backwards compatibility. Use the CompactDatabase method instead."
¤
¤ So I tried with CompactDatabase and my db has been repaired, and is still in
¤ the same access format!
¤

Yes, apparently RepairDatabase was obsolete starting with DAO 3.6. Good thing CompactDatabase can
perform the repair.


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
Hi Sebastien,

I am performing researching on this question, and will get back to you with
more information as soon as possible.

Sincerely,

Kevin
Microsoft Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! - www.microsoft.com/security

--------------------
| From: "Sebastien Lange" <[email protected]>
| References: <[email protected]>
<[email protected]>
<#[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: Access Database corrupted
| Date: Mon, 13 Oct 2003 12:31:04 +0200
| Lines: 385
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| NNTP-Posting-Host: alc244.alcatel.be 195.207.101.244
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:63497
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| I found 90% of the solution. If the user has Access XP or 2003 the
following
| code converts successfully from 2000 to 97:
|
| Type accessType = Type.GetTypeFromProgID("Access.Application");
| object accessApp = Activator.CreateInstance(accessType);
| Console.WriteLine("Access version = " + accessType.InvokeMember("Version",
| BindingFlags.GetProperty, null, accessApp, null).ToString());
| accessType.InvokeMember("ConvertAccessProject", BindingFlags.InvokeMethod,
| null, accessApp, new object[]{"my2Kdb.mdb", "my97db.mdb", 8});
|
| But if the user has Access 2000, there is no ConvertAccessProject
method...
| Do you know any other way/method for Access 2000 users?
|
| Sebastien
|
| | > Hi Sebastien,
| >
| > Yes, this is an issue. You could create three different version of the
| > application. And run the application based on the version of Access on
the
| > user's machine.
| >
| > [More Information]:
| >
| > 317113.KB.EN-US HOW TO: Automate Microsoft Access From Visual Basic .NET
| > http://support.microsoft.com/default.aspx?scid=KB;EN-US;317113
| >
| >
| > Please let me know if this helps in solving your issue.
| >
| >
| >
| > Sincerely,
| >
| > Kevin
| > Microsoft Support
| >
| > This posting is provided "AS IS" with no warranties, and confers no
| rights.
| > Get Secure! - www.microsoft.com/security
| >
| > --------------------
| > | From: "Sebastien Lange" <[email protected]>
| > | References: <[email protected]>
| > <[email protected]>
| > <#[email protected]>
| > <[email protected]>
| > | Subject: Re: Access Database corrupted
| > | Date: Fri, 10 Oct 2003 12:01:44 +0200
| > | Lines: 283
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <[email protected]>
| > | Newsgroups: microsoft.public.dotnet.framework.adonet
| > | NNTP-Posting-Host: alc243.alcatel.be 195.207.101.243
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.framework.adonet:63357
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
| > |
| > | Thanks Kevin,
| > |
| > | This solution works fine if all my customers have the same Access
| version,
| > | so I can reference in the conversion library the good Access object
| > library.
| > | But I don't know which version they have. It can be 97, 2000, XP or
| 2003.
| > | If it is 97, no conversion needed. For others, I should references
the 3
| > | object libraries (Microsoft Access 11.0 Object Library, 10.0 and 9.0),
| > isn't
| > | it? but I don't think I can!!!
| > |
| > | Sebastien
| > |
| > | | > | > Hi Sebastien,
| > | >
| > | > We can programmatically convert the Access 2000/2002 format to
Access
| 97
| > | by
| > | > using the Access object library. The following is the article,
please
| > test
| > | > the method to see if it works for you:
| > | >
| > | >
| > | > Q304318 ACC2002: Programmatically Convert Multiple Access Databases
| > | > http://support.microsoft.com/support/kb/articles/q304/3/18.asp
| > | >
| > | > The /convert switch cannot detect the DefaultDatabaseFormat
property.
| In
| > | > Access 2002, the switch can convert the database only into Access
2000
| > | file
| > | > format.
| > | >
| > | >
| > | >
| > |
| >
|
============================================================================
| > | > ===
| > | >
| >
--------------------------------------------------------------------------
| > | --
| > | > ---
| > | > The information in this article applies to:
| > | >
| > | > - Microsoft Access 2002
| > | >
| > | >
| >
--------------------------------------------------------------------------
| > | --
| > | > ---
| > | >
| > | >
| > | >
| > | > Advanced: Requires expert coding, interoperability, and multiuser
| > skills.
| > | >
| > | >
| > | >
| > | > This article applies only to a Microsoft Access database (.mdb).
| > | >
| > | >
| > | >
| > | >
| > | > SUMMARY
| > | > =======
| > | >
| > | >
| > | > This article shows you two methods that you can use to
| programmatically
| > | > convert Microsoft Access databases. The first method uses the
| > | > ConvertAccessProject method to convert databases to the format that
| you
| > | > specify. The second method uses the Shell function to run
Msaccess.exe
| > | with
| > | > the /convert switch. This second method is embedded in a comment
block
| > in
| > | > the sample code. When you use the second method, the databases will
be
| > | > converted to Access 2000 file format regardless of the Default File
| > Format
| > | > that is specified in the Options dialog box on the Tools menu.
| > | >
| > | >
| > | > MORE INFORMATION
| > | > ================
| > | >
| > | > Microsoft provides programming examples for illustration only,
without
| > | > warranty either
| > | > expressed or implied, including, but not limited to, the implied
| > | warranties
| > | > of
| > | > merchantability and/or fitness for a particular purpose. This
article
| > | > assumes
| > | > that you are familiar with the programming language being
demonstrated
| > and
| > | > the
| > | > tools used to create and debug procedures. Microsoft support
| > professionals
| > | > can
| > | > help explain the functionality of a particular procedure, but they
| will
| > | not
| > | > modify these examples to provide added functionality or construct
| > | > procedures to
| > | > meet your specific needs. If you have limited programming
experience,
| > you
| > | > may
| > | > want to contact a Microsoft Certified Partner or the Microsoft
| fee-based
| > | > consulting line at (800) 936-5200. For more information about
| Microsoft
| > | > Certified
| > | > Partners, please visit the following Microsoft Web site:
| > | >
| > | >
| > | >
| > | > http://www.microsoft.com/partner/referral/
| > | >
| > | >
| > | >
| > | > For more information about the support options that are available
and
| > | about
| > | > how to contact Microsoft, visit the following Microsoft Web site:
| > | >
| > | >
| > | >
| > | > http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS
| > | >
| > | > 1. Open a new or an existing database.
| > | >
| > | > 2. On the Insert menu, click Module. Type the following line in the
| > | > Declarations section if it is not already there:
| > | >
| > | >
| > | > Option Explicit
| > | >
| > | >
| > | > 3. Type or paste the following procedure:
| > | >
| > | >
| > | > Sub ConvertDb(oldDbPath As String, newDbPath As String)
| > | >
| > | > 'NOTE: Uncomment the line Dim x if you are using the
| > | > 'alternative Shell function method listed later in this code.
| > | >
| > | > 'Dim x
| > | >
| > | > Dim strDBName As String
| > | > Dim strOLDDB As String
| > | > Dim strNewDb As String
| > | >
| > | > strDBName = Dir(oldDbPath & "\*.MDB") ' Retrieve the first MDB
file
| > | > entry.
| > | >
| > | > 'Loop though the files in the folder to find MDB files.
| > | >
| > | > Do While strDBName <> ""
| > | > ' Ignore the current folder and the encompassing folder.
| > | > If strDBName <> "." And strDBName <> ".." Then
| > | >
| > | > If Right(strDBName, 3) = "mdb" Then
| > | > strOLDDB = oldDbPath & "\" & strDBName
| > | > strNewDb = newDbPath & "\" & strDBName
| > | >
| > | > 'NOTE: Comment out the following four lines if you are using
| the
| > | > 'Shell function method.
| > | >
| > | > Application.ConvertAccessProject _
| > | > SourceFilename:=strOLDDB, _
| > | > DestinationFilename:=strNewDb, _
| > | > DestinationFileFormat:=acFileFormatAccess2000
| > | >
| > | > 'NOTE: The alternative method is to use the Shell function to
| > open
| > | > 'Access and concatenate the Convert switch instead of using
the
| > | > 'ConvertAccessProject method. To use this method, uncomment
the
| > | > 'following two lines.
| > | >
| > | > ' x = Shell("C:\Program Files\Microsoft
| > | > Office\Office10\MSACCESS.EXE " & Chr(34) _
| > | > ' & strOLDDB & Chr(34) & " /Convert " & Chr(34) &
strNewDb
| &
| > | > Chr(34))
| > | >
| > | > MsgBox "Conversion complete."
| > | > End If
| > | > End If
| > | > strDBName = Dir ' Get next MDB.
| > | > Loop
| > | >
| > | > End Sub
| > | >
| > | >
| > | >
| > | >
| > | > 4. To test this function, create two folders in the root directory
of
| > | drive
| > | > C. Name the folders "DatabasesToConvert" (without the quotation
| marks)
| > | and
| > | > "ConvertedDatabases" (without the quotation marks). Put the
databases
| > | that
| > | > you want to convert in the DatabasesToConvert folder, type the
| following
| > | > line in the Immediate window, and then press ENTER:
| > | >
| > | >
| > | >
| > | > call ConvertDb("C:\DatabasesToConvert", "C:\ConvertedDatabases")
| > | >
| > | >
| > | >
| > | > REFERENCES
| > | > ==========
| > | >
| > | > For more information about the ConvertAccessProject method, in the
| > Visual
| > | > Basic Editor, click Microsoft Visual Basic Help on the Help menu,
type
| > | > convertaccessproject in the Office Assistant or the Answer Wizard,
and
| > | then
| > | > click Search to view the topic.
| > | >
| > | >
| > | > For additional information about database conversion, click the
| article
| > | > number below
| > | > to view the article in the Microsoft Knowledge Base:
| > | >
| > | >
| > | >
| > | > KBLink:319400.KB.EN-US: ACC2002: Conversion White Paper Available in
| > | > the Download Center
| > | >
| > | >
| > | >
| > | >
| > | > Sincerely,
| > | >
| > | > Kevin
| > | > Microsoft Support
| > | >
| > | > This posting is provided "AS IS" with no warranties, and confers no
| > | rights.
| > | > Get Secure! - www.microsoft.com/security
| > | >
| > | > --------------------
| > | > | From: "Sebastien Lange" <[email protected]>
| > | > | References: <[email protected]>
| > | > <[email protected]>
| > | > | Subject: Re: Access Database corrupted
| > | > | Date: Fri, 10 Oct 2003 08:18:19 +0200
| > | > | Lines: 37
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | Message-ID: <#[email protected]>
| > | > | Newsgroups: microsoft.public.dotnet.framework.adonet
| > | > | NNTP-Posting-Host: alc243.alcatel.be 195.207.101.243
| > | > | Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| > | > | Xref: cpmsftngxa06.phx.gbl
| > | microsoft.public.dotnet.framework.adonet:63347
| > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
| > | > |
| > | > | See http://support.microsoft.com/default.aspx?scid=kb;en-us;306287
| > | > |
| > | > |
| > | > |
| > | > | | > | > | > What is JRO? I need to be able to compact an Access db. It
sounds
| > like
| > | > you
| > | > | >
| > | > | > know how to do it. Can you explain it to me?
| > | > | >
| > | > | > Don
| > | > | >
| > message
| > | > | > | > | > | > > Hi,
| > | > | > >
| > | > | > > It seems not possible to repair an access DB programmatically
| with
| > | > | > ADO.NET.
| > | > | > > JRO only compact it, without repairing.
| > | > | > > The only way seems to use MS Office PIAs.
| > | > | > > My customers have Access 97. Is there PIAs for 97? I suppose
no!
| > | Only
| > | > | for
| > | > | > XP
| > | > | > > & 2003, isn't it?
| > | > | > > Then the only possiblity seems to launch Access 97 with my mdb
| as
| > | > | > > argument... and ask the customer to do it himself? any other
| > idea???
| > | > Or
| > | > | > > create a com dll that reference Access 97 and then try to
repair
| > it?
| > | > | > > Any idea?
| > | > | > >
| > | > | > > Thanks,
| > | > | > > Sebastien
| > | > | > >
| > | > | > >
| > | > | >
| > | > | >
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|
 
Thank you Kevin,

The following method from DAO seems to work fine for any Access version. It
does a compact AND a repair. The documentation does not say it does a
repair, but the RepairDatabase method documentation says we should use
CompactDatabase instead.

DBEngine.CompactDatabase olddb, newdb, locale, options, password

Sebastien

Kevin Sun said:
Hi Sebastien,

I am performing researching on this question, and will get back to you with
more information as soon as possible.

Sincerely,

Kevin
Microsoft Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! - www.microsoft.com/security

--------------------
| From: "Sebastien Lange" <[email protected]>
| References: <[email protected]>
<[email protected]>
<#[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: Access Database corrupted
| Date: Mon, 13 Oct 2003 12:31:04 +0200
| Lines: 385
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| NNTP-Posting-Host: alc244.alcatel.be 195.207.101.244
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:63497
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| I found 90% of the solution. If the user has Access XP or 2003 the
following
| code converts successfully from 2000 to 97:
|
| Type accessType = Type.GetTypeFromProgID("Access.Application");
| object accessApp = Activator.CreateInstance(accessType);
| Console.WriteLine("Access version = " + accessType.InvokeMember("Version",
| BindingFlags.GetProperty, null, accessApp, null).ToString());
| accessType.InvokeMember("ConvertAccessProject", BindingFlags.InvokeMethod,
| null, accessApp, new object[]{"my2Kdb.mdb", "my97db.mdb", 8});
|
| But if the user has Access 2000, there is no ConvertAccessProject
method...
| Do you know any other way/method for Access 2000 users?
|
| Sebastien
|
| | > Hi Sebastien,
| >
| > Yes, this is an issue. You could create three different version of the
| > application. And run the application based on the version of Access on
the
| > user's machine.
| >
| > [More Information]:
| >
| > 317113.KB.EN-US HOW TO: Automate Microsoft Access From Visual Basic ..NET
| > http://support.microsoft.com/default.aspx?scid=KB;EN-US;317113
| >
| >
| > Please let me know if this helps in solving your issue.
| >
| >
| >
| > Sincerely,
| >
| > Kevin
| > Microsoft Support
| >
| > This posting is provided "AS IS" with no warranties, and confers no
| rights.
| > Get Secure! - www.microsoft.com/security
| >
| > --------------------
| > | From: "Sebastien Lange" <[email protected]>
| > | References: <[email protected]>
| > <[email protected]>
| > <#[email protected]>
| > <[email protected]>
| > | Subject: Re: Access Database corrupted
| > | Date: Fri, 10 Oct 2003 12:01:44 +0200
| > | Lines: 283
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <[email protected]>
| > | Newsgroups: microsoft.public.dotnet.framework.adonet
| > | NNTP-Posting-Host: alc243.alcatel.be 195.207.101.243
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.framework.adonet:63357
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
| > |
| > | Thanks Kevin,
| > |
| > | This solution works fine if all my customers have the same Access
| version,
| > | so I can reference in the conversion library the good Access object
| > library.
| > | But I don't know which version they have. It can be 97, 2000, XP or
| 2003.
| > | If it is 97, no conversion needed. For others, I should references
the 3
| > | object libraries (Microsoft Access 11.0 Object Library, 10.0 and 9.0),
| > isn't
| > | it? but I don't think I can!!!
| > |
| > | Sebastien
| > |
| > | | > | > Hi Sebastien,
| > | >
| > | > We can programmatically convert the Access 2000/2002 format to
Access
| 97
| > | by
| > | > using the Access object library. The following is the article,
please
| > test
| > | > the method to see if it works for you:
| > | >
| > | >
| > | > Q304318 ACC2002: Programmatically Convert Multiple Access Databases
| > | > http://support.microsoft.com/support/kb/articles/q304/3/18.asp
| > | >
| > | > The /convert switch cannot detect the DefaultDatabaseFormat
property.
| In
| > | > Access 2002, the switch can convert the database only into Access
2000
| > | file
| > | > format.
| > | >
| > | >
| > | >
| > |
| >
|
============================================================================
| > | > ===
| > | >
| >
--------------------------------------------------------------------------
| > | --
| > | > ---
| > | > The information in this article applies to:
| > | >
| > | > - Microsoft Access 2002
| > | >
| > | >
| >
--------------------------------------------------------------------------
| > | --
| > | > ---
| > | >
| > | >
| > | >
| > | > Advanced: Requires expert coding, interoperability, and multiuser
| > skills.
| > | >
| > | >
| > | >
| > | > This article applies only to a Microsoft Access database (.mdb).
| > | >
| > | >
| > | >
| > | >
| > | > SUMMARY
| > | > =======
| > | >
| > | >
| > | > This article shows you two methods that you can use to
| programmatically
| > | > convert Microsoft Access databases. The first method uses the
| > | > ConvertAccessProject method to convert databases to the format that
| you
| > | > specify. The second method uses the Shell function to run
Msaccess.exe
| > | with
| > | > the /convert switch. This second method is embedded in a comment
block
| > in
| > | > the sample code. When you use the second method, the databases will
be
| > | > converted to Access 2000 file format regardless of the Default File
| > Format
| > | > that is specified in the Options dialog box on the Tools menu.
| > | >
| > | >
| > | > MORE INFORMATION
| > | > ================
| > | >
| > | > Microsoft provides programming examples for illustration only,
without
| > | > warranty either
| > | > expressed or implied, including, but not limited to, the implied
| > | warranties
| > | > of
| > | > merchantability and/or fitness for a particular purpose. This
article
| > | > assumes
| > | > that you are familiar with the programming language being
demonstrated
| > and
| > | > the
| > | > tools used to create and debug procedures. Microsoft support
| > professionals
| > | > can
| > | > help explain the functionality of a particular procedure, but they
| will
| > | not
| > | > modify these examples to provide added functionality or construct
| > | > procedures to
| > | > meet your specific needs. If you have limited programming
experience,
| > you
| > | > may
| > | > want to contact a Microsoft Certified Partner or the Microsoft
| fee-based
| > | > consulting line at (800) 936-5200. For more information about
| Microsoft
| > | > Certified
| > | > Partners, please visit the following Microsoft Web site:
| > | >
| > | >
| > | >
| > | > http://www.microsoft.com/partner/referral/
| > | >
| > | >
| > | >
| > | > For more information about the support options that are available
and
| > | about
| > | > how to contact Microsoft, visit the following Microsoft Web site:
| > | >
| > | >
| > | >
| > | > http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS
| > | >
| > | > 1. Open a new or an existing database.
| > | >
| > | > 2. On the Insert menu, click Module. Type the following line in the
| > | > Declarations section if it is not already there:
| > | >
| > | >
| > | > Option Explicit
| > | >
| > | >
| > | > 3. Type or paste the following procedure:
| > | >
| > | >
| > | > Sub ConvertDb(oldDbPath As String, newDbPath As String)
| > | >
| > | > 'NOTE: Uncomment the line Dim x if you are using the
| > | > 'alternative Shell function method listed later in this code.
| > | >
| > | > 'Dim x
| > | >
| > | > Dim strDBName As String
| > | > Dim strOLDDB As String
| > | > Dim strNewDb As String
| > | >
| > | > strDBName = Dir(oldDbPath & "\*.MDB") ' Retrieve the first MDB
file
| > | > entry.
| > | >
| > | > 'Loop though the files in the folder to find MDB files.
| > | >
| > | > Do While strDBName <> ""
| > | > ' Ignore the current folder and the encompassing folder.
| > | > If strDBName <> "." And strDBName <> ".." Then
| > | >
| > | > If Right(strDBName, 3) = "mdb" Then
| > | > strOLDDB = oldDbPath & "\" & strDBName
| > | > strNewDb = newDbPath & "\" & strDBName
| > | >
| > | > 'NOTE: Comment out the following four lines if you are using
| the
| > | > 'Shell function method.
| > | >
| > | > Application.ConvertAccessProject _
| > | > SourceFilename:=strOLDDB, _
| > | > DestinationFilename:=strNewDb, _
| > | > DestinationFileFormat:=acFileFormatAccess2000
| > | >
| > | > 'NOTE: The alternative method is to use the Shell function to
| > open
| > | > 'Access and concatenate the Convert switch instead of using
the
| > | > 'ConvertAccessProject method. To use this method, uncomment
the
| > | > 'following two lines.
| > | >
| > | > ' x = Shell("C:\Program Files\Microsoft
| > | > Office\Office10\MSACCESS.EXE " & Chr(34) _
| > | > ' & strOLDDB & Chr(34) & " /Convert " & Chr(34) &
strNewDb
| &
| > | > Chr(34))
| > | >
| > | > MsgBox "Conversion complete."
| > | > End If
| > | > End If
| > | > strDBName = Dir ' Get next MDB.
| > | > Loop
| > | >
| > | > End Sub
| > | >
| > | >
| > | >
| > | >
| > | > 4. To test this function, create two folders in the root directory
of
| > | drive
| > | > C. Name the folders "DatabasesToConvert" (without the quotation
| marks)
| > | and
| > | > "ConvertedDatabases" (without the quotation marks). Put the
databases
| > | that
| > | > you want to convert in the DatabasesToConvert folder, type the
| following
| > | > line in the Immediate window, and then press ENTER:
| > | >
| > | >
| > | >
| > | > call ConvertDb("C:\DatabasesToConvert", "C:\ConvertedDatabases")
| > | >
| > | >
| > | >
| > | > REFERENCES
| > | > ==========
| > | >
| > | > For more information about the ConvertAccessProject method, in the
| > Visual
| > | > Basic Editor, click Microsoft Visual Basic Help on the Help menu,
type
| > | > convertaccessproject in the Office Assistant or the Answer Wizard,
and
| > | then
| > | > click Search to view the topic.
| > | >
| > | >
| > | > For additional information about database conversion, click the
| article
| > | > number below
| > | > to view the article in the Microsoft Knowledge Base:
| > | >
| > | >
| > | >
| > | > KBLink:319400.KB.EN-US: ACC2002: Conversion White Paper Available in
| > | > the Download Center
| > | >
| > | >
| > | >
| > | >
| > | > Sincerely,
| > | >
| > | > Kevin
| > | > Microsoft Support
| > | >
| > | > This posting is provided "AS IS" with no warranties, and confers no
| > | rights.
| > | > Get Secure! - www.microsoft.com/security
| > | >
| > | > --------------------
| > | > | From: "Sebastien Lange" <[email protected]>
| > | > | References: <[email protected]>
| > | > <[email protected]>
| > | > | Subject: Re: Access Database corrupted
| > | > | Date: Fri, 10 Oct 2003 08:18:19 +0200
| > | > | Lines: 37
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | Message-ID: <#[email protected]>
| > | > | Newsgroups: microsoft.public.dotnet.framework.adonet
| > | > | NNTP-Posting-Host: alc243.alcatel.be 195.207.101.243
| > | > | Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| > | > | Xref: cpmsftngxa06.phx.gbl
| > | microsoft.public.dotnet.framework.adonet:63347
| > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
| > | > |
| > | > | See http://support.microsoft.com/default.aspx?scid=kb;en-us;306287
| > | > |
| > | > |
| > | > |
| > | > | | > | > | > What is JRO? I need to be able to compact an Access db. It
sounds
| > like
| > | > you
| > | > | >
| > | > | > know how to do it. Can you explain it to me?
| > | > | >
| > | > | > Don
| > | > | >
| > message
| > | > | > | > | > | > > Hi,
| > | > | > >
| > | > | > > It seems not possible to repair an access DB programmatically
| with
| > | > | > ADO.NET.
| > | > | > > JRO only compact it, without repairing.
| > | > | > > The only way seems to use MS Office PIAs.
| > | > | > > My customers have Access 97. Is there PIAs for 97? I suppose
no!
| > | Only
| > | > | for
| > | > | > XP
| > | > | > > & 2003, isn't it?
| > | > | > > Then the only possiblity seems to launch Access 97 with my mdb
| as
| > | > | > > argument... and ask the customer to do it himself? any other
| > idea???
| > | > Or
| > | > | > > create a com dll that reference Access 97 and then try to
repair
| > it?
| > | > | > > Any idea?
| > | > | > >
| > | > | > > Thanks,
| > | > | > > Sebastien
| > | > | > >
| > | > | > >
| > | > | >
| > | > | >
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|
 
Hi Sebastien,

I am glad to learn that you have found a complete resoultion on this
problem. The following are some additional information that may help you:

294966.KB.EN-US PRB: RepairDatabase Method Is No Longer Available in DAO 3.6
http://support.microsoft.com/default.aspx?scid=KB;EN-US;294966

230501.KB.EN-US HOWTO: Compact Microsoft Access Database Through ADO
http://support.microsoft.com/default.aspx?scid=KB;EN-US;230501

Sincerely,

Kevin
Microsoft Support

This posting is provided "AS IS" with no warranties, and confers no rights.
Get Secure! - www.microsoft.com/security

--------------------
| From: "Sebastien Lange" <[email protected]>
| References: <[email protected]>
<[email protected]>
<#[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
<[email protected]>
| Subject: Re: Access Database corrupted
| Date: Thu, 16 Oct 2003 08:14:18 +0200
| Lines: 489
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.adonet
| NNTP-Posting-Host: alc245.alcatel.be 195.207.101.245
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.adonet:63746
| X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
|
| Thank you Kevin,
|
| The following method from DAO seems to work fine for any Access version.
It
| does a compact AND a repair. The documentation does not say it does a
| repair, but the RepairDatabase method documentation says we should use
| CompactDatabase instead.
|
| DBEngine.CompactDatabase olddb, newdb, locale, options, password
|
| Sebastien
|
| | > Hi Sebastien,
| >
| > I am performing researching on this question, and will get back to you
| with
| > more information as soon as possible.
| >
| > Sincerely,
| >
| > Kevin
| > Microsoft Support
| >
| > This posting is provided "AS IS" with no warranties, and confers no
| rights.
| > Get Secure! - www.microsoft.com/security
| >
| > --------------------
| > | From: "Sebastien Lange" <[email protected]>
| > | References: <[email protected]>
| > <[email protected]>
| > <#[email protected]>
| > <[email protected]>
| > <[email protected]>
| > <[email protected]>
| > | Subject: Re: Access Database corrupted
| > | Date: Mon, 13 Oct 2003 12:31:04 +0200
| > | Lines: 385
| > | X-Priority: 3
| > | X-MSMail-Priority: Normal
| > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | Message-ID: <[email protected]>
| > | Newsgroups: microsoft.public.dotnet.framework.adonet
| > | NNTP-Posting-Host: alc244.alcatel.be 195.207.101.244
| > | Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
| > | Xref: cpmsftngxa06.phx.gbl
| microsoft.public.dotnet.framework.adonet:63497
| > | X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
| > |
| > | I found 90% of the solution. If the user has Access XP or 2003 the
| > following
| > | code converts successfully from 2000 to 97:
| > |
| > | Type accessType = Type.GetTypeFromProgID("Access.Application");
| > | object accessApp = Activator.CreateInstance(accessType);
| > | Console.WriteLine("Access version = " +
| accessType.InvokeMember("Version",
| > | BindingFlags.GetProperty, null, accessApp, null).ToString());
| > | accessType.InvokeMember("ConvertAccessProject",
| BindingFlags.InvokeMethod,
| > | null, accessApp, new object[]{"my2Kdb.mdb", "my97db.mdb", 8});
| > |
| > | But if the user has Access 2000, there is no ConvertAccessProject
| > method...
| > | Do you know any other way/method for Access 2000 users?
| > |
| > | Sebastien
| > |
| > | | > | > Hi Sebastien,
| > | >
| > | > Yes, this is an issue. You could create three different version of
the
| > | > application. And run the application based on the version of Access
on
| > the
| > | > user's machine.
| > | >
| > | > [More Information]:
| > | >
| > | > 317113.KB.EN-US HOW TO: Automate Microsoft Access From Visual Basic
| .NET
| > | > http://support.microsoft.com/default.aspx?scid=KB;EN-US;317113
| > | >
| > | >
| > | > Please let me know if this helps in solving your issue.
| > | >
| > | >
| > | >
| > | > Sincerely,
| > | >
| > | > Kevin
| > | > Microsoft Support
| > | >
| > | > This posting is provided "AS IS" with no warranties, and confers no
| > | rights.
| > | > Get Secure! - www.microsoft.com/security
| > | >
| > | > --------------------
| > | > | From: "Sebastien Lange" <[email protected]>
| > | > | References: <[email protected]>
| > | > <[email protected]>
| > | > <#[email protected]>
| > | > <[email protected]>
| > | > | Subject: Re: Access Database corrupted
| > | > | Date: Fri, 10 Oct 2003 12:01:44 +0200
| > | > | Lines: 283
| > | > | X-Priority: 3
| > | > | X-MSMail-Priority: Normal
| > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | Message-ID: <[email protected]>
| > | > | Newsgroups: microsoft.public.dotnet.framework.adonet
| > | > | NNTP-Posting-Host: alc243.alcatel.be 195.207.101.243
| > | > | Path:
cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
| > | > | Xref: cpmsftngxa06.phx.gbl
| > | microsoft.public.dotnet.framework.adonet:63357
| > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
| > | > |
| > | > | Thanks Kevin,
| > | > |
| > | > | This solution works fine if all my customers have the same Access
| > | version,
| > | > | so I can reference in the conversion library the good Access
object
| > | > library.
| > | > | But I don't know which version they have. It can be 97, 2000, XP
or
| > | 2003.
| > | > | If it is 97, no conversion needed. For others, I should references
| > the 3
| > | > | object libraries (Microsoft Access 11.0 Object Library, 10.0 and
| 9.0),
| > | > isn't
| > | > | it? but I don't think I can!!!
| > | > |
| > | > | Sebastien
| > | > |
| > | > | | > | > | > Hi Sebastien,
| > | > | >
| > | > | > We can programmatically convert the Access 2000/2002 format to
| > Access
| > | 97
| > | > | by
| > | > | > using the Access object library. The following is the article,
| > please
| > | > test
| > | > | > the method to see if it works for you:
| > | > | >
| > | > | >
| > | > | > Q304318 ACC2002: Programmatically Convert Multiple Access
| Databases
| > | > | > http://support.microsoft.com/support/kb/articles/q304/3/18.asp
| > | > | >
| > | > | > The /convert switch cannot detect the DefaultDatabaseFormat
| > property.
| > | In
| > | > | > Access 2002, the switch can convert the database only into
Access
| > 2000
| > | > | file
| > | > | > format.
| > | > | >
| > | > | >
| > | > | >
| > | > |
| > | >
| > |
| >
|
============================================================================
| > | > | > ===
| > | > | >
| > | >
| >
--------------------------------------------------------------------------
| > | > | --
| > | > | > ---
| > | > | > The information in this article applies to:
| > | > | >
| > | > | > - Microsoft Access 2002
| > | > | >
| > | > | >
| > | >
| >
--------------------------------------------------------------------------
| > | > | --
| > | > | > ---
| > | > | >
| > | > | >
| > | > | >
| > | > | > Advanced: Requires expert coding, interoperability, and
multiuser
| > | > skills.
| > | > | >
| > | > | >
| > | > | >
| > | > | > This article applies only to a Microsoft Access database (.mdb).
| > | > | >
| > | > | >
| > | > | >
| > | > | >
| > | > | > SUMMARY
| > | > | > =======
| > | > | >
| > | > | >
| > | > | > This article shows you two methods that you can use to
| > | programmatically
| > | > | > convert Microsoft Access databases. The first method uses the
| > | > | > ConvertAccessProject method to convert databases to the format
| that
| > | you
| > | > | > specify. The second method uses the Shell function to run
| > Msaccess.exe
| > | > | with
| > | > | > the /convert switch. This second method is embedded in a comment
| > block
| > | > in
| > | > | > the sample code. When you use the second method, the databases
| will
| > be
| > | > | > converted to Access 2000 file format regardless of the Default
| File
| > | > Format
| > | > | > that is specified in the Options dialog box on the Tools menu.
| > | > | >
| > | > | >
| > | > | > MORE INFORMATION
| > | > | > ================
| > | > | >
| > | > | > Microsoft provides programming examples for illustration only,
| > without
| > | > | > warranty either
| > | > | > expressed or implied, including, but not limited to, the implied
| > | > | warranties
| > | > | > of
| > | > | > merchantability and/or fitness for a particular purpose. This
| > article
| > | > | > assumes
| > | > | > that you are familiar with the programming language being
| > demonstrated
| > | > and
| > | > | > the
| > | > | > tools used to create and debug procedures. Microsoft support
| > | > professionals
| > | > | > can
| > | > | > help explain the functionality of a particular procedure, but
they
| > | will
| > | > | not
| > | > | > modify these examples to provide added functionality or
construct
| > | > | > procedures to
| > | > | > meet your specific needs. If you have limited programming
| > experience,
| > | > you
| > | > | > may
| > | > | > want to contact a Microsoft Certified Partner or the Microsoft
| > | fee-based
| > | > | > consulting line at (800) 936-5200. For more information about
| > | Microsoft
| > | > | > Certified
| > | > | > Partners, please visit the following Microsoft Web site:
| > | > | >
| > | > | >
| > | > | >
| > | > | > http://www.microsoft.com/partner/referral/
| > | > | >
| > | > | >
| > | > | >
| > | > | > For more information about the support options that are
available
| > and
| > | > | about
| > | > | > how to contact Microsoft, visit the following Microsoft Web
site:
| > | > | >
| > | > | >
| > | > | >
| > | > | > http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS
| > | > | >
| > | > | > 1. Open a new or an existing database.
| > | > | >
| > | > | > 2. On the Insert menu, click Module. Type the following line in
| the
| > | > | > Declarations section if it is not already there:
| > | > | >
| > | > | >
| > | > | > Option Explicit
| > | > | >
| > | > | >
| > | > | > 3. Type or paste the following procedure:
| > | > | >
| > | > | >
| > | > | > Sub ConvertDb(oldDbPath As String, newDbPath As String)
| > | > | >
| > | > | > 'NOTE: Uncomment the line Dim x if you are using the
| > | > | > 'alternative Shell function method listed later in this code.
| > | > | >
| > | > | > 'Dim x
| > | > | >
| > | > | > Dim strDBName As String
| > | > | > Dim strOLDDB As String
| > | > | > Dim strNewDb As String
| > | > | >
| > | > | > strDBName = Dir(oldDbPath & "\*.MDB") ' Retrieve the first MDB
| > file
| > | > | > entry.
| > | > | >
| > | > | > 'Loop though the files in the folder to find MDB files.
| > | > | >
| > | > | > Do While strDBName <> ""
| > | > | > ' Ignore the current folder and the encompassing folder.
| > | > | > If strDBName <> "." And strDBName <> ".." Then
| > | > | >
| > | > | > If Right(strDBName, 3) = "mdb" Then
| > | > | > strOLDDB = oldDbPath & "\" & strDBName
| > | > | > strNewDb = newDbPath & "\" & strDBName
| > | > | >
| > | > | > 'NOTE: Comment out the following four lines if you are
| using
| > | the
| > | > | > 'Shell function method.
| > | > | >
| > | > | > Application.ConvertAccessProject _
| > | > | > SourceFilename:=strOLDDB, _
| > | > | > DestinationFilename:=strNewDb, _
| > | > | > DestinationFileFormat:=acFileFormatAccess2000
| > | > | >
| > | > | > 'NOTE: The alternative method is to use the Shell
function
| to
| > | > open
| > | > | > 'Access and concatenate the Convert switch instead of
using
| > the
| > | > | > 'ConvertAccessProject method. To use this method,
uncomment
| > the
| > | > | > 'following two lines.
| > | > | >
| > | > | > ' x = Shell("C:\Program Files\Microsoft
| > | > | > Office\Office10\MSACCESS.EXE " & Chr(34) _
| > | > | > ' & strOLDDB & Chr(34) & " /Convert " & Chr(34) &
| > strNewDb
| > | &
| > | > | > Chr(34))
| > | > | >
| > | > | > MsgBox "Conversion complete."
| > | > | > End If
| > | > | > End If
| > | > | > strDBName = Dir ' Get next MDB.
| > | > | > Loop
| > | > | >
| > | > | > End Sub
| > | > | >
| > | > | >
| > | > | >
| > | > | >
| > | > | > 4. To test this function, create two folders in the root
directory
| > of
| > | > | drive
| > | > | > C. Name the folders "DatabasesToConvert" (without the quotation
| > | marks)
| > | > | and
| > | > | > "ConvertedDatabases" (without the quotation marks). Put the
| > databases
| > | > | that
| > | > | > you want to convert in the DatabasesToConvert folder, type the
| > | following
| > | > | > line in the Immediate window, and then press ENTER:
| > | > | >
| > | > | >
| > | > | >
| > | > | > call ConvertDb("C:\DatabasesToConvert", "C:\ConvertedDatabases")
| > | > | >
| > | > | >
| > | > | >
| > | > | > REFERENCES
| > | > | > ==========
| > | > | >
| > | > | > For more information about the ConvertAccessProject method, in
| the
| > | > Visual
| > | > | > Basic Editor, click Microsoft Visual Basic Help on the Help
menu,
| > type
| > | > | > convertaccessproject in the Office Assistant or the Answer
Wizard,
| > and
| > | > | then
| > | > | > click Search to view the topic.
| > | > | >
| > | > | >
| > | > | > For additional information about database conversion, click the
| > | article
| > | > | > number below
| > | > | > to view the article in the Microsoft Knowledge Base:
| > | > | >
| > | > | >
| > | > | >
| > | > | > KBLink:319400.KB.EN-US: ACC2002: Conversion White Paper
Available
| in
| > | > | > the Download Center
| > | > | >
| > | > | >
| > | > | >
| > | > | >
| > | > | > Sincerely,
| > | > | >
| > | > | > Kevin
| > | > | > Microsoft Support
| > | > | >
| > | > | > This posting is provided "AS IS" with no warranties, and confers
| no
| > | > | rights.
| > | > | > Get Secure! - www.microsoft.com/security
| > | > | >
| > | > | > --------------------
| > | > | > | From: "Sebastien Lange" <[email protected]>
| > | > | > | References: <[email protected]>
| > | > | > <[email protected]>
| > | > | > | Subject: Re: Access Database corrupted
| > | > | > | Date: Fri, 10 Oct 2003 08:18:19 +0200
| > | > | > | Lines: 37
| > | > | > | X-Priority: 3
| > | > | > | X-MSMail-Priority: Normal
| > | > | > | X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| > | > | > | X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| > | > | > | Message-ID: <#[email protected]>
| > | > | > | Newsgroups: microsoft.public.dotnet.framework.adonet
| > | > | > | NNTP-Posting-Host: alc243.alcatel.be 195.207.101.243
| > | > | > | Path:
| > cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP10.phx.gbl
| > | > | > | Xref: cpmsftngxa06.phx.gbl
| > | > | microsoft.public.dotnet.framework.adonet:63347
| > | > | > | X-Tomcat-NG: microsoft.public.dotnet.framework.adonet
| > | > | > |
| > | > | > | See
| http://support.microsoft.com/default.aspx?scid=kb;en-us;306287
| > | > | > |
| > | > | > |
| > | > | > |
| > | > | > | | > | > | > | > What is JRO? I need to be able to compact an Access db. It
| > sounds
| > | > like
| > | > | > you
| > | > | > | >
| > | > | > | > know how to do it. Can you explain it to me?
| > | > | > | >
| > | > | > | > Don
| > | > | > | >
in
| > | > message
| > | > | > | > | > | > | > | > > Hi,
| > | > | > | > >
| > | > | > | > > It seems not possible to repair an access DB
| programmatically
| > | with
| > | > | > | > ADO.NET.
| > | > | > | > > JRO only compact it, without repairing.
| > | > | > | > > The only way seems to use MS Office PIAs.
| > | > | > | > > My customers have Access 97. Is there PIAs for 97? I
suppose
| > no!
| > | > | Only
| > | > | > | for
| > | > | > | > XP
| > | > | > | > > & 2003, isn't it?
| > | > | > | > > Then the only possiblity seems to launch Access 97 with my
| mdb
| > | as
| > | > | > | > > argument... and ask the customer to do it himself? any
other
| > | > idea???
| > | > | > Or
| > | > | > | > > create a com dll that reference Access 97 and then try to
| > repair
| > | > it?
| > | > | > | > > Any idea?
| > | > | > | > >
| > | > | > | > > Thanks,
| > | > | > | > > Sebastien
| > | > | > | > >
| > | > | > | > >
| > | > | > | >
| > | > | > | >
| > | > | > |
| > | > | > |
| > | > | > |
| > | > | >
| > | > |
| > | > |
| > | > |
| > | >
| > |
| > |
| > |
| >
|
|
|
 
Back
Top