We will pay $100 dollars to any programmer who can GET the Document
Number value from the Database Properties area of an ADP & ADE (Access
2000 and up file format) from A VB PROJECT...
See this link to a screen shot for any clarification you might need on
exactly what part of the ADP file i am babbling about... Database
Properties - Custom Tab - Document Number Value
http://www.enflow.com/ScreenShotADP.htm
Chris James
831-649-4659
Monterey, CA.
A possible solution would be to use the DsoFile.dll library, however, I
don't know if it will work with ADP and ADE:
http://www.microsoft.com/technet/community/columns/scripts/sg0305.mspx
Please answer back if you try it to tell us if it has worked or not.
--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF
<cj_...@comcast.net> wrote in message
news:1139073361.4...@o13g2000cwo.googlegroups.com...
I will look into your link and that library too... if i get any joy i
will report back...
cj...
Private Const cerrPropertyNotFound As Integer = 2455
Public Sub SetProperty(ByVal strPropName As String, _
ByVal varPropType_Bidon As Integer, _
ByVal varPropValue As Variant)
Const cProcedureName As String = "SetProperty"
On Error GoTo Err_Handler
Dim db As CurrentProject
Set db = Application.CurrentProject
If (IsNull(varPropValue)) Then varPropValue = ""
Dim i
For i = 0 To db.Properties.Count - 1
If (db.Properties(i).name = strPropName) Then
db.Properties(strPropName).Value = varPropValue
GoTo Exit_Sub
End If
Next
db.Properties.Add strPropName, varPropValue
Exit_Sub:
On Error GoTo 0
Set db = Nothing
Exit Sub
Err_Handler:
' Err_Handler: utilisée dans l'ancienne version.
Select Case err
Case cerrPropertyNotFound
db.Properties.Add strPropName, varPropValue
Case Else
' Call LogError(Err.Number, Err.Description, cModuleName &
cProcedureName)
End Select
Resume Exit_Sub
End Sub
' GetProperty() will return True if it find the property or else will
return False.
' The property iteself is returned as the argument strPropValue.
Public Function GetProperty(ByVal strPropName As String, _
ByRef strPropValue As Variant) As Boolean
Const cProcedureName As String = "GetProperty"
On Error GoTo Err_Handler
Dim db As CurrentProject
Set db = Application.CurrentProject
Dim i
For i = 0 To db.Properties.Count - 1
If (db.Properties(i).name = strPropName) Then
strPropValue = db.Properties(strPropName)
GetProperty = True
GoTo Exit_Function
End If
Next
' Property not found.
GetProperty = False
Exit_Function:
On Error GoTo 0
Set db = Nothing
Exit Function
Err_Handler:
GetProperty = False
Select Case err
Case cerrPropertyNotFound
Case Else
' Call LogError(Err.Number, Err.Description, cModuleName &
cProcedureName)
End Select
Resume Exit_Function
End Function
--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF
<cj_...@comcast.net> wrote in message
news:1139108026.9...@g44g2000cwa.googlegroups.com...
c> Get ADP Custom Database Property - Document Number Value ** $100 To
c> Anybody Can Do It... i don't care if it takes you 15 seconds...
1. download OLE object from http://support.microsoft.com/Default.aspx?kbid=224351
and regsvr32 the library..
2. The download will have VB6 sample; it won't 100% work with ADP file, but
the following essential code will do what you want:
Dim m_oDocumentProps As DSOFile.OleDocumentProperties
Set m_oDocumentProps = New DSOFile.OleDocumentProperties
m_oDocumentProps.Open "myadp.adp", True,
dsoOptionOpenReadOnlyIfNoWriteAccess
MsgBox m_oDocumentProps.CustomProperties("document number")
m_oDocumentProps.Close
Note that with this library, your program won't even have to call Access to
open the ADP project, it reads the properties directly from the file.
regards,
Vadim Rapp
SL> Database Properties and Custom Database Properties are not exactly the
SL> same thing.
I think the properties on these pages are not related to the database. Those
are custom file properties, similar to version info of the exe file, and the
interface to deal with that is called IFilter. It's the same thing that
shows bitrate of mp3 file or shutter value of the digital picture in the
status bar of the window in explorer, and they are available as columns in
folder's detailed view (if you customize it). An application can register
new custom properties with Windows, and then use them through that
interface. The complete list of all registered properties is visible in
computer management/indexing service/system/properties. There's an article
about it and other shell enhancements at http://msdn.microsoft.com/msdnmag/issues/01/11/XPShell/
Vadim Rapp
As we don't know what the OP want to do with these properties, I've added
this piece of information just in case.
--
Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: http://cerbermail.com/?QugbLEWINF
"Vadim Rapp" <v...@myrealbox.nospam.com> wrote in message
news:OkSTQ1o...@tk2msftngp13.phx.gbl...
db.Containers("databases").Documents("UserDefined").Properties
and "Database Properties" are
db.Containers("databases").Documents("MSysDb").Properties
which is the same as
db.Properties
ie MSysDb is the default document of the default container, and, in an MDB,
both kinds of properties are the same kind of object (dao.property)
Obviously, not the same in this context.
(david)
"Sylvain Lafontaine" <sylvain aei ca (fill the blanks, no spam please)>
wrote in message news:upmg$9gKGH...@TK2MSFTNGP09.phx.gbl...