![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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 |
#3
| |||
| |||
|
|
That approach should still work. See if this does: http://allenbrowne.com/ser-53code.html#GetFileFormat |
#4
| |||
| |||
|
|
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 |
#5
| |||
| |||
|
|
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. |
#6
| |||
| |||
|
|
"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. |
#7
| |||
| |||
|
|
So any ideas? |
#8
| |||
| |||
|
|
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 |
#9
| |||
| |||
|
|
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 |
![]() |
| Thread Tools | |
| Display Modes | |
| |