Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1044 connectés 

  FORUM HardWare.fr
  Programmation

  Access? nettoyer la base?

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Access? nettoyer la base?

n°69665
saxgard
Posté le 05-11-2001 à 13:15:43  profilanswer
 

j'aimerai savoir comment ce fait-il que , quand je delete tt les champs de chaque table de ma base , elle fait toujours la meme taille.
Les données sont elles concervées ailleur dans la base?

 

[edtdd]--Message édité par saxgard--[/edtdd]

mood
Publicité
Posté le 05-11-2001 à 13:15:43  profilanswer
 

n°69674
neriki
oenologue
Posté le 05-11-2001 à 14:26:15  profilanswer
 

Parce qu'il faut la compacter: menu outils > utilitaires de base de donnees > compacter la base de donnees.
 
En fait access n'efface pas les donnees, il les marques seulement indisponible pour gagner en vitesse, elles seront ensuites efface lors du compactage.

n°69736
saxgard
Posté le 05-11-2001 à 15:56:29  profilanswer
 

peut-on compacter par le code directement sans passé par access?

n°69740
Bloodymary​_
Posté le 05-11-2001 à 16:00:57  profilanswer
 

Oui
 
methode CompactDatabase
 
 ;)

n°69761
DJERO
Yoooup...merde ça marche pas..
Posté le 05-11-2001 à 17:03:58  profilanswer
 

Comment ça marche, cela m'interrese très fortement !
:D

n°69763
n0mad
inscrit au XXe siècle
Posté le 05-11-2001 à 17:08:30  profilanswer
 

C'est la méthode (statique) CDaoWorkspace::CompactDatabase qui s'occupe de ça. C'est possible par DAO et par DBJet.
 
Plus d'infos :  
http://msdn.microsoft.com/library/ [...] tabase.asp


---------------
Pipiru piru piru pipiru pi
n°69921
DJERO
Yoooup...merde ça marche pas..
Posté le 06-11-2001 à 12:58:00  profilanswer
 

Je comprends rien du tout :cry:
Peux tu me donner un exemple fonctionnel, se serait vraiment sympa ;)

n°70581
saxgard
Posté le 08-11-2001 à 09:48:01  profilanswer
 

ui j'aimerai bien aussi avoir un exemple ;)
 
juste a titre indicatif  , ca serai pour nettoyer une base d'un forum en ASP  :D

 

[edtdd]--Message édité par saxgard--[/edtdd]

n°70684
saxgard
Posté le 08-11-2001 à 15:07:59  profilanswer
 

up

n°70690
DJERO
Yoooup...merde ça marche pas..
Posté le 08-11-2001 à 15:19:37  profilanswer
 

re up :D

mood
Publicité
Posté le 08-11-2001 à 15:19:37  profilanswer
 

n°70694
la viper
Posté le 08-11-2001 à 15:22:27  profilanswer
 

CDaoWorkspace::CompactDatabase
static void PASCAL CompactDatabase( LPCTSTR lpszSrcName, LPCTSTR lpszDestName, LPCTSTR lpszLocale = dbLangGeneral, int nOptions = 0 );
throw( CDaoException, CMemoryException );
 
static void PASCAL CompactDatabase( LPCTSTR lpszSrcName, LPCTSTR lpszDestName, LPCTSTR lpszLocale, int nOptions, LPCTSTR lpszPassword );
throw( CDaoException, CMemoryException );
 
Parameters
 
lpszSrcName
 
The name of an existing, closed database. It can be a full path and filename, such as “C:\\MYDB.MDB”. If the filename has an extension, you must specify it. If your network supports the uniform naming convention (UNC), you can also specify a network path, such as “\\\\MYSERVER\\MYSHARE\\MYDIR\\MYDB.MDB”. (Double backslashes are required in the path strings because “\” is the C++ escape character.)
 
lpszDestName
 
The full path of the compacted database that you are creating. You can also specify a network path as with lpszSrcName. You cannot use the lpszDestName argument to specify the same database file as lpszSrcName.
 
lpszPassword
 
A password, used when you want to compact a password-protected database. Note that if you use the version of CompactDatabase that takes a password, you must supply all parameters. Also, because this is a connect parameter, it requires special formatting, as follows: ;PWD=lpszPassword. For example: ;PWD=“Happy”. (The leading semicolon is required.)
 
lpszLocale
 
A string expression used to specify collating order for creating lpszDestName. If you omit this argument by accepting the default value of dbLangGeneral (see below), the locale of the new database is the same as that of the old database. Possible values are:  
 
dbLangGeneral   English, German, French, Portuguese, Italian, and Modern Spanish
 
 
dbLangArabic   Arabic
 
 
dbLangCyrillic   Russian
 
 
dbLangCzech   Czech
 
 
dbLangDutch   Dutch
 
 
dbLangGreek   Greek
 
 
dbLangHebrew   Hebrew
 
 
dbLangHungarian   Hungarian
 
 
dbLangIcelandic   Icelandic
 
 
dbLangNordic   Nordic languages (Microsoft Jet database engine version 1.0 only)
 
 
dbLangNorwdan   Norwegian and Danish
 
 
dbLangPolish   Polish
 
 
dbLangSpanish   Traditional Spanish
 
 
dbLangSwedfin   Swedish and Finnish
 
 
dbLangTurkish   Turkish  
nOptions
 
Indicates one or more options for the target database, lpszDestName. If you omit this argument by accepting the default value, the lpszDestName will have the same encryption and the same version as lpszSrcName. You can combine the dbEncrypt or dbDecrypt option with one of the version options using the bitwise-OR operator. Possible values, which specify a database format, not a database engine version, are:  
 
dbEncrypt   Encrypt the database while compacting.
 
 
dbDecrypt   Decrypt the database while compacting.
 
 
dbVersion10   Create a database that uses the Microsoft Jet database engine version 1.0 while compacting.
 
 
dbVersion11   Create a database that uses the Microsoft Jet database engine version 1.1 while compacting.
 
 
dbVersion20   Create a database that uses the Microsoft Jet database engine version 2.0 while compacting.
 
 
dbVersion30   Create a database that uses the Microsoft Jet database engine version 3.0 while compacting.
You can use dbEncrypt or dbDecrypt in the options argument to specify whether to encrypt or to decrypt the database as it is compacted. If you omit an encryption constant or if you include both dbDecrypt and dbEncrypt, lpszDestName will have the same encryption as lpszSrcName. You can use one of the version constants in the options argument to specify the version of the data format for the compacted database. This constant affects only the version of the data format of lpszDestName. You can specify only one version constant. If you omit a version constant, lpszDestName will have the same version as lpszSrcName. You can compact lpszDestName only to a version that is the same or later than that of lpszSrcName.
 
CAUTION   If a database is not encrypted, it is possible, even if you implement user/password security, to directly read the binary disk file that constitutes the database.
 
Remarks
 
Call this member function to compact a specified Microsoft Jet (.MDB) database. As you change data in a database, the database file can become fragmented and use more disk space than necessary. Periodically, you should compact your database to defragment the database file. The compacted database is usually smaller. You can also choose to change the collating order, the encryption, or the version of the data format while you copy and compact the database.  
 
! WARNING   The CompactDatabase member function will not correctly convert a complete Microsoft Access database from one version to another. Only the data format is converted. Microsoft Access-defined objects, such as forms and reports, are not converted. However, the data is correctly converted.
 
Tip   You can also use CompactDatabase to copy a database file.
 
For more information about workspaces, see the articleDAO Workspace in Visual C++ Programmer's Guide. For more information about compacting databases, see the topic "CompactDatabase Method" in DAO Help.
 
CDaoWorkspace Overview |  Class Members |  Hierarchy Chart
 
See Also   CDaoWorkspace::RepairDatabase

n°70697
DJERO
Yoooup...merde ça marche pas..
Posté le 08-11-2001 à 15:25:33  profilanswer
 

ce ne serai pas un ptit copié/collé ?

n°70698
saxgard
Posté le 08-11-2001 à 15:26:11  profilanswer
 

vi tt ca je l'ai vu sur:
 
http://msdn.microsoft.com/library/ [...] tabase.asp  
 
mais la ou j'ai un petit pb c'est dans l'utilisation de cette object en asp  :D

n°70742
DJERO
Yoooup...merde ça marche pas..
Posté le 08-11-2001 à 16:22:24  profilanswer
 

idem :D

n°70916
saxgard
Posté le 09-11-2001 à 09:25:07  profilanswer
 

piti up , s'vouplais aidez 2 pauvres malheureux  :(  
nous avons besoin de vous , vous etes nos sauveurs

n°70933
mandrin0
Prononcer MandrinZéro
Posté le 09-11-2001 à 10:53:36  profilanswer
 

Sub CompactDatabaseX()
 
   Dim dbsNorthwind As Database
 
   Set dbsNorthwind = OpenDatabase("Comptoir.mdb" )
 
   ' Montre les propriétés de la base de données de  
   ' départ.
   With dbsNorthwind
      Debug.Print .Name & ", version " & .Version
      Debug.Print "  CollatingOrder = " & .CollatingOrder
      .Close
   End With
 
   ' Vérifie qu'aucun fichier ne porte le nom de la  
   ' base de données compressé.
   If Dir("NwindKorean.mdb" ) <> "" Then _
      Kill "NwindKorean.mdb"
 
   ' Cette instruction crée une version compressée de  
   ' la  
   ' base de données Comptoir utilisant un ordre de  
   ' classement  
   ' coréen.
   DBEngine.CompactDatabase "Comptoir.mdb", _
      "NwindKorean.mdb", dbLangKorean
 
   Set dbsNorthwind = OpenDatabase("NwindKorean.mdb" )
 
   ' Affiche les propriétés de la base de données  
   ' compressée.
   With dbsNorthwind
      Debug.Print .Name & ", version " & .Version
      Debug.Print "  CollatingOrder = " & .CollatingOrder
      .Close
   End With
 
End Sub


---------------
Si j'etais Dieu, et ben j'croirai pas en moi..Et si j'etais moi, et ben j'me mefierai
n°70967
saxgard
Posté le 09-11-2001 à 13:46:01  profilanswer
 

je te remercie , mais tca c'est du VB, hors en asp c'est du vbscript ce qui est different non? ,  
 
il me semble que  
 
Dim dbsNorthwind As Database  
Set dbsNorthwind = OpenDatabase("Comptoir.mdb" )  
ne passera pas non?
 
je crois que j'avais deja rencontré des pb quand j'avais essayé ce type de procédure dans de l'asp  
 
mais bon peut etr que je dis une grosse boulette ce qui m'étonnerai pas  :D

n°70980
mandrin0
Prononcer MandrinZéro
Posté le 09-11-2001 à 14:57:36  profilanswer
 

saxgard a écrit a écrit :

je te remercie , mais tca c'est du VB, hors en asp c'est du vbscript ce qui est different non? ,  
 
il me semble que  
 
Dim dbsNorthwind As Database  
Set dbsNorthwind = OpenDatabase("Comptoir.mdb" )  
ne passera pas non?
 
je crois que j'avais deja rencontré des pb quand j'avais essayé ce type de procédure dans de l'asp  
 
mais bon peut etr que je dis une grosse boulette ce qui m'étonnerai pas  :D  




 
ben pour la déclaration, ya pas un truc du genre ADODB.database?


---------------
Si j'etais Dieu, et ben j'croirai pas en moi..Et si j'etais moi, et ben j'me mefierai
n°70988
saxgard
Posté le 09-11-2001 à 15:16:45  profilanswer
 

ui c possible je te remercie , je vais essayé ca
 
j'ai aussi trouvé ca :
 
http://www.c2i.fr/asp/code.asp?IDCode=158

n°72052
DJERO
Yoooup...merde ça marche pas..
Posté le 14-11-2001 à 09:47:44  profilanswer
 

Ca a l'air de correspondre.
As tu rencontré des pb pour intégrer ce code ?

n°72103
saxgard
Posté le 14-11-2001 à 12:45:58  profilanswer
 

non je n'est pas encore eu le temps d'essayé ;) et toi?

n°72185
DJERO
Yoooup...merde ça marche pas..
Posté le 14-11-2001 à 15:19:51  profilanswer
 

C'est en cour...

n°72228
saxgard
Posté le 14-11-2001 à 16:15:19  profilanswer
 

oki cool
au fait tu essaye quoi ce quepropose mandrin0 ou ce qui a sur  
http://www.c2i.fr/asp/code.asp?IDCode=158 ?
 
fais moi signe quand tu aura fini pourmetenir au courant ca m'interesse ;)
 
NB: c'est quand meme pourri de devoir faire des manipulaution supplémentaire pour compresser la base  :D

n°72413
DJERO
Yoooup...merde ça marche pas..
Posté le 15-11-2001 à 11:22:39  profilanswer
 

ok :D

n°72414
DJERO
Yoooup...merde ça marche pas..
Posté le 15-11-2001 à 11:23:34  profilanswer
 

Ah oui, j'essais d'intégrer la source de C2i.fr

n°72428
saxgard
Posté le 15-11-2001 à 12:31:48  profilanswer
 

oki bin tiens moi au courant ca serai sympas , et surtt si ta du porter des modification  etc..
 
je te remercie @++++

n°74089
saxgard
Posté le 21-11-2001 à 14:16:43  profilanswer
 

Djero ta pu essayer alors? ;)

n°78881
DJERO
Yoooup...merde ça marche pas..
Posté le 06-12-2001 à 16:47:24  profilanswer
 

OUI ! :D Si tu veux je te mail la source :D

n°78887
DJERO
Yoooup...merde ça marche pas..
Posté le 06-12-2001 à 16:57:49  profilanswer
 

Alors ?

mood
Publicité
Posté le   profilanswer
 


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation

  Access? nettoyer la base?

 

Sujets relatifs
[BDD Windows] à part Access ???enregistrement dans une base de données MySQL
[Access/SQLServer] Fonctions equivalentes a DATEDIFF() et GETDATE() ?[HTML] avec include php... Please. Une petite info de base
[VB + Access ] debutant avec ADO ... " un objet est requis"Access : paramétrer les propriétés d'un formulaire via VB
VB + Base de registrequestion sur ACCESS et le web
Access, asp et requete SQL qui deconne....[SQL SERVER 7.0] Administrer la base a distance
Plus de sujets relatifs à : Access? nettoyer la base?


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR