Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

System.Session Object "Cannot Update. Datebase or object is read-only"

Status
Not open for further replies.

krisbest86

Programmer
Nov 4, 2015
2
GB
I want to get data from the other programme. When I run the code below I get error:
3027 Cannot Update. Datebase or object is ready-only. It occurs at the line I highlighted.
Any help would be very appreciated.

Sub MainObject()

Set System = CreateObject("EXTRA.System") ' Gets the system object
System.TimeoutValue = 500
If (System Is Nothing) Then
'
Else
Set Sessions = System.Sessions
If Not (Sessions Is Nothing) Then
' Set the default wait timeout value
g_HostSettleTime = 500 ' milliseconds
OldSystemTimeout& = System.TimeoutValue
If (g_HostSettleTime > OldSystemTimeout) Then
System.TimeoutValue = g_HostSettleTime
End If
' Get the necessary Session Object

Set Sess0 = System.ActiveSession
If (Sess0 Is Nothing) Then
MsgBox "Could not create the Session object. Stopping macro playback."

Else
If Not Sess0.Visible Then Sess0.Visible = True
[highlight #FCE94F] Sess0.Screen.WaitHostQuiet (g_HostSettleTime)[/highlight]
End If
End If
End If


End Sub
 
Not sure I can understand how an EXTRA! Attachmate session would raise an MS Access error ...
 
why does it MS Access error and it does not when i run code in Excel file?
 
OK, a generic database error. But still don't see from what you've shown us here why an Extra! Attachmate session should raise a database runtime error.
 
Hi,

You have 5 IFs and only 4 End Ifs.

Check your code.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
[blush]

Check Extra VB HELP on the syntax for waitQuietHost

Normally, the only cases when WAITING is necessary, is when you send a command to the mainframe, which processes the command asynchronously. Then you cannot simply wait a fixed period of time, like 500 ms. It's more like waiting at a stop sign in your car, until the intersection is clear of crossing traffic: you must use something like WaitForCursor in a loop until the cursor returns to the Screen Rest Coordinates.

Skip,
[sub]
[glasses]Just traded in my OLD subtlety...
for a NUance![tongue][/sub]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top