Home > Archive > SQL Anywhere ultralite > September 2005 > Help Needed in Ultralite ActiveX on Tablet PC









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Help Needed in Ultralite ActiveX on Tablet PC
Eric Beser

2005-08-28, 11:23 am

I am building a small application on a Tablet PC and using the Ultralite
component in Visual Basic 6.0 for the desktop.

My platform is 9.0.2 and I am using the Ultralite 9.0 active X control.
Everything else works except setting the Streamparms string in the SyncParms
object.

I need to set this so that the application will know what the ip address of
the mobilink service is, so that synchronization can occur on this server.

I keep getting an error:

Object doesn't support this property or method.

The object browser shows that the connection.syncparms object is read only,
so I created a ulsyncparms object and set the connection.syncparms object to
this variable. You would think that the streamparms property (shown as a
string) is not read only, and is shown as a property of the syncparms
object. Setting host=192.etc; fails on this error.

How do you set the streamparms parameter of the connection to the host ip
otherwise?

There are no examples of how to do this, and no examples of using the
dbmlsync activex component in VB6 (if this is appropriate).

Does anyone have a quick example of how to set the stream parameter in
visual basic 6 to synchronize to a mobilink server on another system?

Thanks

Eric


Greg Fenton

2005-08-29, 3:23 am

Eric Beser wrote:
>
> My platform is 9.0.2 and I am using the Ultralite 9.0 active X control.
> Everything else works except setting the Streamparms string in the SyncParms
> object.
>


Can you show us the code you have tried that is failing?


> There are no examples of how to do this, and no examples of using the
> dbmlsync activex component in VB6 (if this is appropriate).


Using the DBMLSync ActiveX component would *not* be appropriate.
UltraLite has built-in synchronization, whereas dbmlsync is the
synchronization client for an ASA remote database.

greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
Eric L. Beser

2005-08-29, 7:23 am

Sure:
GetSetting pulls the string "host=192.168.0.5;" from the registry

How else do I tell this application where the mobilink service is located?

Public Sub EnableSync()
Dim SynP As ULSyncParms
On Error GoTo errHandler



Form_Sync.InitSyncForm DatabaseMgr
Set SynP = Connection.SyncParms
SynP.StreamParms = GetSetting("assetWB", "sync", "sync_parms", "")

Connection.Synchronize (True)

If GetError <> ulSQLE_NOERROR And _
GetError <> ulSQLE_INTERRUPTED Then
MsgBox ("Synchronization error: " & Err.Description)
End If
Err.Clear
CloseOut
Initialize
' Refresh the data

UpdateMainForm


Exit Sub
Exit Sub
errHandler:
ErrorIn "database.EnableSync"
HandleError
End Sub
"Greg Fenton" <greg. fenton_nospam_@ianyw
here.com> wrote in message
news:431272a3$1@foru
ms-2-dub...
> Eric Beser wrote:
SyncParms[color=dark
red]
>
> Can you show us the code you have tried that is failing?
>
>
>
> Using the DBMLSync ActiveX component would *not* be appropriate.
> UltraLite has built-in synchronization, whereas dbmlsync is the
> synchronization client for an ASA remote database.
>
> greg.fenton
> --
> Greg Fenton
> Consultant, Solution Services, iAnywhere Solutions
> --------
> Visit the iAnywhere Solutions Developer Community
> Whitepapers, TechDocs, Downloads
> http://www.ianywhere.com/developer/



Eric L. Beser

2005-08-29, 7:23 am

I forgot to say that the syncP.streamparms line is what is failing.

"Eric L. Beser" <eric. beser@NOSPAMennovate
inc.com> wrote in message
news:4312e348$1@foru
ms-1-dub...
> Sure:
> GetSetting pulls the string "host=192.168.0.5;" from the registry
>
> How else do I tell this application where the mobilink service is located?
>
> Public Sub EnableSync()
> Dim SynP As ULSyncParms
> On Error GoTo errHandler
>
>
>
> Form_Sync.InitSyncForm DatabaseMgr
> Set SynP = Connection.SyncParms
> SynP.StreamParms = GetSetting("assetWB", "sync", "sync_parms", "")
>
> Connection.Synchronize (True)
>
> If GetError <> ulSQLE_NOERROR And _
> GetError <> ulSQLE_INTERRUPTED Then
> MsgBox ("Synchronization error: " & Err.Description)
> End If
> Err.Clear
> CloseOut
> Initialize
> ' Refresh the data
>
> UpdateMainForm
>
>
> Exit Sub
> Exit Sub
> errHandler:
> ErrorIn "database.EnableSync"
> HandleError
> End Sub
> "Greg Fenton" <greg. fenton_nospam_@ianyw
here.com> wrote in message
> news:431272a3$1@foru
ms-2-dub...
control.[color=darkred]
> SyncParms
>
>



Greg Fenton

2005-08-29, 11:23 am

Eric L. Beser wrote:
> Set SynP = Connection.SyncParms
> SynP.StreamParms = GetSetting("assetWB", "sync", "sync_parms", "")
>


Have you set the Stream at this point?

Have you seen the synchronization code in the UL ActiveX tutorial? In
the ASA 9.x online docs, see:

UltraLite ActiveX User's Guide
Tutorial: A Sample UltraLite ActiveX Application
Lesson 3: Write the sample code
- Write code to synchronize


greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
Eric L. Beser

2005-08-30, 3:24 am

Yes, I read this. I do just as the example says. The only difference is that
I need to set the streamparms (stream is set to TCPIP) to set the host to
connect to.

The sync fails because it doesn't see the mobilink server.

"Greg Fenton" <greg. fenton_NOSPAM_@ianyw
here.com> wrote in message
news:43132931@forums
-2-dub...
> Eric L. Beser wrote:
"")[color=darkred]
>
> Have you set the Stream at this point?
>
> Have you seen the synchronization code in the UL ActiveX tutorial? In
> the ASA 9.x online docs, see:
>
> UltraLite ActiveX User's Guide
> Tutorial: A Sample UltraLite ActiveX Application
> Lesson 3: Write the sample code
> - Write code to synchronize
>
>
> greg.fenton
> --
> Greg Fenton
> Consultant, Solution Services, iAnywhere Solutions
> --------
> Visit the iAnywhere Solutions Developer Community
> Whitepapers, TechDocs, Downloads
> http://www.ianywhere.com/developer/



Eric L. Beser

2005-08-30, 9:25 am

Greg,

The problem is not one of connectivity.

The error is "Object does not support this method"

The code to do synchronization is as follows with the line marked where the
error occurs.

Public Sub EnableSync()
Dim SynP As ULSyncParms
On Error GoTo errHandler
Form_Sync.InitSyncForm DatabaseMgr
Set SynP = Connection.SyncParms

If UserChange Then
ReplaceUserID CInt(m_UserID)
SynP.SyncParms.UserName = m_UserIDStr

m_NewUser = True
End If
If SiteChange Then
ReplaceSiteID m_SiteID
cLocation.ClearSite
End If

SynP.Stream = ulTCPIP
SynP.StreamParms = GetSetting("assetWB", "sync", "sync_parms", "")
'**************\\
'NOTE: The above line fails with "Object does not support this method"

'GetSetting returns the string "host=192.168.0.5;"

'There is an mobilink server running at that address and the tablet has
access to that server.

'This is a tablet PC. My appforge code running on this machine works
flawlessly, but I can't deliver 'appforge to every customer.

The code below this doesn't get to execute as the error occured above.
'*****************\\


Connection.Synchronize (True)

If Err.Number <> ulSQLE_NOERROR And _
Err.Number <> ulSQLE_INTERRUPTED Then
MsgBox ("Synchronization error: " & Err.Description)
End If
Err.Clear
CloseOut
Initialize
' Refresh the data

UpdateMainForm


Exit Sub
Exit Sub
errHandler:
ErrorIn "database.EnableSync"
HandleError
End Sub
"Greg Fenton" <greg. fenton_NOSPAM_@ianyw
here.com> wrote in message
news:43132931@forums
-2-dub...
> Eric L. Beser wrote:
"")[color=darkred]
>
> Have you set the Stream at this point?
>
> Have you seen the synchronization code in the UL ActiveX tutorial? In
> the ASA 9.x online docs, see:
>
> UltraLite ActiveX User's Guide
> Tutorial: A Sample UltraLite ActiveX Application
> Lesson 3: Write the sample code
> - Write code to synchronize
>
>
> greg.fenton
> --
> Greg Fenton
> Consultant, Solution Services, iAnywhere Solutions
> --------
> Visit the iAnywhere Solutions Developer Community
> Whitepapers, TechDocs, Downloads
> http://www.ianywhere.com/developer/



Greg Fenton

2005-08-30, 11:25 am

I have not used the ActiveX interface before, but comparing your code to
the tutorial code, I see these differences:

Eric L. Beser wrote:
> Public Sub EnableSync()
> Dim SynP As ULSyncParms
> On Error GoTo errHandler
> Form_Sync.InitSyncForm DatabaseMgr
> Set SynP = Connection.SyncParms
>
> If UserChange Then
> ReplaceUserID CInt(m_UserID)
> SynP.SyncParms.UserName = m_UserIDStr


Shouldn't this be: SynP.UserName = ...

>
> m_NewUser = True
> End If
> If SiteChange Then
> ReplaceSiteID m_SiteID
> cLocation.ClearSite
> End If
>
> SynP.Stream = ulTCPIP


Shouldn't this be: SynP.Stream = ULStreamType.ulTCPIP

> SynP.StreamParms = GetSetting("assetWB", "sync", "sync_parms", "")




Obviously if you cannot set the StreamParms, then there's no need to
chase down problems with the ML server configuration. So for now it is
a matter of figuring out why the SynP.StreamParms call is failing. I'm
hoping that the above two changes will resolve the issue somewhat, but
post back and let us know what the new behaviour is.

Your code is not that much different from that of the tutorial page. If
the above changes don't resolve anything, try copying the code from the
tutorial into your function and adding the line:

parms.StreamParms = "host=192.168.0.5"

before the call to Connection.Synchronize and see if that gets you any
further.

Hope this helps,
greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
Eric L. Beser

2005-08-30, 11:25 am

You were right about the syntax issue on the call. The actual code had the
correct ussage.

However I still cannot set the streamparms with either the results of the
call or hard coded ip address.

My colleage thinks that the parameter was coded as a constant (which is read
only) by mistake and may be a bug in the activex dll itself. there is a
surprisingly little in the way of examples.

Is there another way of letting the connection know where the mobilink
server is on winxp. What is a workaround?


"Greg Fenton" <greg. fenton_NOSPAM_@ianyw
here.com> wrote in message
news:431470e7$1@foru
ms-2-dub...
> I have not used the ActiveX interface before, but comparing your code to
> the tutorial code, I see these differences:
>
> Eric L. Beser wrote:
>
> Shouldn't this be: SynP.UserName = ...
>
>
> Shouldn't this be: SynP.Stream = ULStreamType.ulTCPIP
>
"")[color=darkred]
>
>
>
> Obviously if you cannot set the StreamParms, then there's no need to
> chase down problems with the ML server configuration. So for now it is
> a matter of figuring out why the SynP.StreamParms call is failing. I'm
> hoping that the above two changes will resolve the issue somewhat, but
> post back and let us know what the new behaviour is.
>
> Your code is not that much different from that of the tutorial page. If
> the above changes don't resolve anything, try copying the code from the
> tutorial into your function and adding the line:
>
> parms.StreamParms = "host=192.168.0.5"
>
> before the call to Connection.Synchronize and see if that gets you any
> further.
>
> Hope this helps,
> greg.fenton
> --
> Greg Fenton
> Consultant, Solution Services, iAnywhere Solutions
> --------
> Visit the iAnywhere Solutions Developer Community
> Whitepapers, TechDocs, Downloads
> http://www.ianywhere.com/developer/



Chris Retterath

2005-09-08, 1:25 pm

The property is called
StreamParams
and it is a read/write string value on the ULSyncParms object, which is part
of the connection object.

Could your syntax error be due to mistyping this as "StreamParms"?

The samples show this set, for example in
samples\UltraLiteAct
iveX\dbview.evb\form_Sync.ebf:
Connection.SyncParms.StreamParams = txtStreamParams.Text
(admittedly this is eMbedded VB, not VB, but the same property name applies)

Chris Retterath, iAnywhere Solutions

"Eric L. Beser" <eric. beser@NOSPAMennovate
inc.com> wrote in message
news:4314779d$1@foru
ms-2-dub...
> You were right about the syntax issue on the call. The actual code had the
> correct ussage.
>
> However I still cannot set the streamparms with either the results of the
> call or hard coded ip address.
>
> My colleage thinks that the parameter was coded as a constant (which is
> read
> only) by mistake and may be a bug in the activex dll itself. there is a
> surprisingly little in the way of examples.
>
> Is there another way of letting the connection know where the mobilink
> server is on winxp. What is a workaround?
>
>
> "Greg Fenton" <greg. fenton_NOSPAM_@ianyw
here.com> wrote in message
> news:431470e7$1@foru
ms-2-dub...
> "")
>
>



Greg Fenton

2005-09-08, 8:23 pm

Chris Retterath wrote:
> The property is called
> StreamParams


Hmm...this appears to be a documentation bug.

UltraLite ActiveX User's Guide
UltraLite ActiveX API Reference
ULSyncParms class
- Properties

I am posting a docs enhancement request.

greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/
Eric L. Beser

2005-09-08, 8:23 pm

Thanks guys. This solved the problem

We are off!
"Greg Fenton" <greg. fenton_NOSPAM_@ianyw
here.com> wrote in message
news:43208422$1@foru
ms-1-dub...
> Chris Retterath wrote:
>
> Hmm...this appears to be a documentation bug.
>
> UltraLite ActiveX User's Guide
> UltraLite ActiveX API Reference
> ULSyncParms class
> - Properties
>
> I am posting a docs enhancement request.
>
> greg.fenton
> --
> Greg Fenton
> Consultant, Solution Services, iAnywhere Solutions
> --------
> Visit the iAnywhere Solutions Developer Community
> Whitepapers, TechDocs, Downloads
> http://www.ianywhere.com/developer/



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com