dbTalk Databases Forums  

Detecting Accde database

comp.databases.ms-access comp.databases.ms-access


Discuss Detecting Accde database in the comp.databases.ms-access forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Phil
 
Posts: n/a

Default Detecting Accde database - 06-20-2010 , 06:35 AM






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

Reply With Quote
  #2  
Old   
Allen Browne
 
Posts: n/a

Default Re: Detecting Accde database - 06-20-2010 , 09:52 AM






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 (AT) stantonfamily (DOT) co.uk> wrote

Quote:
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

Reply With Quote
  #3  
Old   
Phil
 
Posts: n/a

Default Re: Detecting Accde database - 06-20-2010 , 04:06 PM



On 20/06/2010 15:52:50, "Allen Browne" wrote:
Quote:
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

Reply With Quote
  #4  
Old   
Phil
 
Posts: n/a

Default Re: Detecting Accde database - 06-20-2010 , 04:09 PM



On 20/06/2010 22:06:31, "Phil" wrote:
Quote:
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

Reply With Quote
  #5  
Old   
David W. Fenton
 
Posts: n/a

Default Re: Detecting Accde database - 06-20-2010 , 04:50 PM



"Phil" <phil (AT) stantonfamily (DOT) co.uk> wrote in
news:FdudndHoCrc4HoPRnZ2dnUVZ8nSdnZ2d (AT) brightview (DOT) co.uk:

Quote:
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/

Reply With Quote
  #6  
Old   
Phil
 
Posts: n/a

Default Re: Detecting Accde database - 06-20-2010 , 05:34 PM



On 20/06/2010 22:50:00, "David W. Fenton" wrote:
Quote:
"Phil" <phil (AT) stantonfamily (DOT) co.uk> wrote in
news:FdudndHoCrc4HoPRnZ2dnUVZ8nSdnZ2d (AT) brightview (DOT) 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.

Culpa Mea David,

I know.

With h Office 2000 you don't appear to be able to do a mailmerge with an MDE
database, so as you said, I change the name to MDB and mail merge is quite
happy.

So any ideas?

Phil

Reply With Quote
  #7  
Old   
David W. Fenton
 
Posts: n/a

Default Re: Detecting Accde database - 06-21-2010 , 07:52 PM



"Phil" <phil (AT) stantonfamily (DOT) co.uk> wrote in
news:FIydnQ599Kz0CoPRnZ2dnUVZ7rqdnZ2d (AT) brightview (DOT) co.uk:

Quote:
So any ideas?
I would browse the properties of an ACCDE to see if anything obvious
stands out. I'd expect something similar to the old MDE property.

If that fails, another thing to try would be to attempt to read the
content of a module, which should fail in an MDE/ACCDE.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/

Reply With Quote
  #8  
Old   
Jon Lewis
 
Posts: n/a

Default Re: Detecting Accde database - 06-23-2010 , 04:55 AM



As far as I can see (with A2007 SP2) the database property "MDE" still
exists in an ACCDE and has Value "T". Is doesn't exist in an ACCDB so your
function should still work fine if you just trap the error 3270 "Property
Not Found".

Jon.




"Phil" <phil (AT) stantonfamily (DOT) co.uk> wrote

Quote:
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

Reply With Quote
  #9  
Old   
Phil
 
Posts: n/a

Default Re: Detecting Accde database - 06-27-2010 , 07:12 PM



On 23/06/2010 10:55:20, "Jon Lewis" wrote:
Quote:
As far as I can see (with A2007 SP2) the database property "MDE" still
exists in an ACCDE and has Value "T". Is doesn't exist in an ACCDB so your
function should still work fine if you just trap the error 3270 "Property
Not Found".

Jon.




"Phil" <phil (AT) stantonfamily (DOT) co.uk> wrote in message
news:x42dnV_frIqcYIDRnZ2dnUVZ7sidnZ2d (AT) brightview (DOT) 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


Thanks Jon. It appears that it does

Phil

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.