From: Phil on
This code worked in AK2 for seeing whether a database was an MDb or MDe

Function IsItMDE() As Boolean

On Error Resume Next
Dim strMDE As String

strMDE = CurrentDb.Properties("MDE")
IsItMDE = ((Err = 0) And (strMDE = "T"))

End Function

Can anyone tell me the equivalent for checkin an Accdb adainst an Accde

This didn't help

Function ListDbProps()

Dim i As Long
On Error Resume Next

For i = 1 To 1000
Debug.Print "i: " & i & " Name: " & CurrentDb.Properties(i).Name & " Prop: "
& CurrentDb.Properties(i) Next i

End Function

Thanks

Phil
From: Allen Browne on
That approach should still work.

See if this does:
http://allenbrowne.com/ser-53code.html#GetFileFormat

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"Phil" <phil(a)stantonfamily.co.uk> wrote in message
news:x42dnV_frIqcYIDRnZ2dnUVZ7sidnZ2d(a)brightview.co.uk...
> This code worked in AK2 for seeing whether a database was an MDb or MDe
>
> Function IsItMDE() As Boolean
>
> On Error Resume Next
> Dim strMDE As String
>
> strMDE = CurrentDb.Properties("MDE")
> IsItMDE = ((Err = 0) And (strMDE = "T"))
>
> End Function
>
> Can anyone tell me the equivalent for checkin an Accdb adainst an Accde
>
> This didn't help
>
> Function ListDbProps()
>
> Dim i As Long
> On Error Resume Next
>
> For i = 1 To 1000
> Debug.Print "i: " & i & " Name: " & CurrentDb.Properties(i).Name & " Prop:
> "
> & CurrentDb.Properties(i) Next i
>
> End Function
>
> Thanks
>
> Phil

From: Phil on
On 20/06/2010 15:52:50, "Allen Browne" wrote:
> That approach should still work.
>
> See if this does:
> http://allenbrowne.com/ser-53code.html#GetFileFormat
>

Thanks Allen

'Fraid not.
The line bIsCompiledOnly = (db.Properties("MDE") = "T") drops out to the
error routine, not surprisind as we are looking for an "AccDE". Error is
"Property Not Found"

Ditto with db.Properties("AccDE")

Phil
From: Phil on
On 20/06/2010 22:06:31, "Phil" wrote:
> On 20/06/2010 15:52:50, "Allen Browne" wrote:
>> That approach should still work.
>>
>> See if this does:
>> http://allenbrowne.com/ser-53code.html#GetFileFormat
>>
>
> Thanks Allen
>
> 'Fraid not.
> The line bIsCompiledOnly = (db.Properties("MDE") = "T") drops out to the
> error routine, not surprisind as we are looking for an "AccDE". Error is
> "Property Not Found"
>
> Ditto with db.Properties("AccDE")
>
> Phil
>

Hi Allen

I ment to add

Function DBType() As String

DBType Type = Right(CurrentDb.Name, Len(CurrentDb.Name) -
InStrRev(CurrentDb.Name, ".")) ' end of database name

End Function

works OK, but I don't think it's very watertight.

Phil
From: David W. Fenton on
"Phil" <phil(a)stantonfamily.co.uk> wrote in
news:FdudndHoCrc4HoPRnZ2dnUVZ8nSdnZ2d(a)brightview.co.uk:

> I ment to add
>
> Function DBType() As String
>
> DBType Type = Right(CurrentDb.Name, Len(CurrentDb.Name) -
> InStrRev(CurrentDb.Name, ".")) ' end of database name
>
> End Function
>
> works OK, but I don't think it's very watertight.

It isn't even close, as the extension can be any arbitrary
characters. You could change the MDE extension to MDB and nothing
would happen at all.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
 |  Next  |  Last
Pages: 1 2
Prev: Command Button wizard in 2007
Next: Can't delete module