INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Databases and tables

How to avoid (Connection Busy) error when using remote views by steveb7
Posted: 11 May 06

Particularly useful when working with large datasets
I created this little function to work with the
CursorGetProp("ConnectHandle",RemoteView)
and
SQLGetProp(nHandle,"ConnectBusy")
functions to pause continued processing until all the data is fetched

CODE

Function GetRemoteView
Parameters DatabaseFile As String, RemoteView As String
lReturnValue=.F.
If Empty(RemoteView) .Or. Type("RemoteView")<>"C" .Or. Empty(DatabaseFile) .Or. Type("DatabaseFile")<>"C"
    Return (lReturnValue)
Endif
If !Dbused(DatabaseFile)
    Open Database (DatabaseFile) Shared
Endif
ctempWorkArea=Select(0)
If Used(RemoteView)
    Use (RemoteView) In (RemoteView)
Else
    Use (RemoteView) In 0
Endif

Select (RemoteView)
Go Bott
nHandle=CursorGetProp("ConnectHandle",RemoteView)
Do While SQLGetProp(nHandle,"ConnectBusy")
    =Inkey(1,"H")
Enddo
If Used(RemoteView)
    Select (RemoteView)
    Go Top
    Select (ctempWorkArea)
    lReturnValue=.T.
Else
    Select (ctempWorkArea)
    lReturnValue=.F.
Endif

Return (lReturnValue)

Back to Microsoft: Visual FoxPro FAQ Index
Back to Microsoft: Visual FoxPro Forum

My Archive

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close