A
Alp
Hi Experts,
I am facing problems with the following under an MS Access Runtime
environment. Is this a "typical" runtime restriction or am I missing
something?
RT is Access2000, OS is NT. The app runs ssemingly without any problem but
if any form is opened almost instantly an error is generated and the
application closes. The interesting aspect is, there is nothing new under
these forms. Only some code changes under the startup form which does open,
display proper data and behaves normally.
Another point is; when the FE is run from another PC on the network, neither
the startup nor the main menu is displayed. Still all relevant froms are
accessible and functional via the custom menubar. This is temporarily
resolved by commenting the following codes that were called behind the
startup:
Public Function ShowHowManyUsers()
Dim cn As Variant 'New ADODB.Connection
Dim rs As Variant 'As New ADODB.Recordset
Dim i, j As Long
Set cn = CreateObject("ADODB.Connection")
cn.Provider = "Microsoft.Jet.OLEDB.4.0"
cn.Open "Data Source=" & CurrentDb.Name
Set rs = cn.OpenSchema(-1, , "{947bb102-5d43-11d1-bdbf-00c04fb92675}")
i = 0
While Not rs.EOF
'Debug.Print rs.Fields(0), rs.Fields(1), rs.Fields(2), rs.Fields(3)
i = i + 1
rs.MoveNext
Wend
ShowHowManyUsers = i - 1
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing
End Function
and this one:
Public Function SDBase()
Dim fs, d
If VBA.Left(lokasyon, 2) = "\\" Then
dPth = VBA.Left(lokasyon, (InStr(3, lokasyon, "\", vbTextCompare)))
Else
dPth = VBA.Left(lokasyon, InStr(1, lokasyon, "\", vbTextCompare))
End If
Set fs = CreateObject("Scripting.FileSystemObject")
Set d = fs.GetDrive(fs.GetDriveName(fs.GetAbsolutePathName(dPth)))
SDBase = d.SerialNumber
Set d = Nothing
Set fs = Nothing
End Function
As a reference the code of "lokasyon" is:
Public Function lokasyon()
vtnm = CurrentDb.Name
lokasyon = Left(vtnm, LastInStr(vtnm, "\"))
End Function
Clear as mud?
Thanks in advance.
Alp
I am facing problems with the following under an MS Access Runtime
environment. Is this a "typical" runtime restriction or am I missing
something?
RT is Access2000, OS is NT. The app runs ssemingly without any problem but
if any form is opened almost instantly an error is generated and the
application closes. The interesting aspect is, there is nothing new under
these forms. Only some code changes under the startup form which does open,
display proper data and behaves normally.
Another point is; when the FE is run from another PC on the network, neither
the startup nor the main menu is displayed. Still all relevant froms are
accessible and functional via the custom menubar. This is temporarily
resolved by commenting the following codes that were called behind the
startup:
Public Function ShowHowManyUsers()
Dim cn As Variant 'New ADODB.Connection
Dim rs As Variant 'As New ADODB.Recordset
Dim i, j As Long
Set cn = CreateObject("ADODB.Connection")
cn.Provider = "Microsoft.Jet.OLEDB.4.0"
cn.Open "Data Source=" & CurrentDb.Name
Set rs = cn.OpenSchema(-1, , "{947bb102-5d43-11d1-bdbf-00c04fb92675}")
i = 0
While Not rs.EOF
'Debug.Print rs.Fields(0), rs.Fields(1), rs.Fields(2), rs.Fields(3)
i = i + 1
rs.MoveNext
Wend
ShowHowManyUsers = i - 1
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing
End Function
and this one:
Public Function SDBase()
Dim fs, d
If VBA.Left(lokasyon, 2) = "\\" Then
dPth = VBA.Left(lokasyon, (InStr(3, lokasyon, "\", vbTextCompare)))
Else
dPth = VBA.Left(lokasyon, InStr(1, lokasyon, "\", vbTextCompare))
End If
Set fs = CreateObject("Scripting.FileSystemObject")
Set d = fs.GetDrive(fs.GetDriveName(fs.GetAbsolutePathName(dPth)))
SDBase = d.SerialNumber
Set d = Nothing
Set fs = Nothing
End Function
As a reference the code of "lokasyon" is:
Public Function lokasyon()
vtnm = CurrentDb.Name
lokasyon = Left(vtnm, LastInStr(vtnm, "\"))
End Function
Clear as mud?
Thanks in advance.
Alp