Home > Archive > SQL Anywhere Mobile > November 2005 > Dbmlsync Integration Component









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 Dbmlsync Integration Component
Billy

2005-10-31, 3:24 am

Hi,

I know there is a visual component, dbmlsynccomg.dll,
provided to use in dot Net.
However, when I tried to add it into toolbox, it said the
dll was not a Microsoft .Net Module ...
My project is going to deploy on PocketPC, so that I chose
the one in <sybase 9>\ce\arm.30\
(P.S Actually, there is no difference to select another one
in other files.)

Can anyone suggest what's wrong?
Thank you very much!

Billy

dbeng -v 9.0.2.3198
David Fishburn

2005-10-31, 9:24 am

Billy wrote in news:4365d8a1.51cb.1681692777@sybase.com
of sybase.public.sqlanywhere.mobilink:

B> I know there is a visual component, dbmlsynccomg.dll,
B> provided to use in dot Net.
B> However, when I tried to add it into toolbox, it said the
B> dll was not a Microsoft .Net Module ...
B> My project is going to deploy on PocketPC, so that I chose
B> the one in <sybase 9>\ce\arm.30\
B> (P.S Actually, there is no difference to select another one
B> in other files.)

Unfortunately, that component only works on the desktop. It uses
ActiveX which is not supported in the .Net *Compact* framework.
--
David Fishburn
Certified ASA Developer Version 8
iAnywhere Solutions - Sybase
Professional Services
Please only post to the newsgroup
Please ALWAYS include version and MORE importantly BUILD number with
EACH post (dbeng9 -v).

EBFs and Maintenance Releases
http://downloads.sybase.com/swx/sdmain.stm

Developer Community / Whitepapers
http://www.ianywhere.com/developer

CaseXpress - to report bugs
http://casexpress.sybase.com

CodeXchange - Free samples
[url]http://ianywhere.codexchange.sybase.com/servlets/ ProjectDocumentList[
/url]

Liam Cavanagh

2005-11-01, 8:48 pm

I have heard of people who have been successful in running ActiveX
components using the .NET Framework using third party tools. I believe one
of them is Odyssey Software CFCOM

http://msdn.microsoft.com/library/d.../html/cfcom.asp

--
Liam Cavanagh
Sr. Product Manager
Certified ASA Developer Version 8
iAnywhere
"David Fishburn" <fishburn_spam@off.ianywhere.com> wrote in message
news:Xns970055C158E6
5fishburnsybasecom@1
27.0.0.1...
> Billy wrote in news:4365d8a1.51cb.1681692777@sybase.com
> of sybase.public.sqlanywhere.mobilink:
>
> B> I know there is a visual component, dbmlsynccomg.dll,
> B> provided to use in dot Net.
> B> However, when I tried to add it into toolbox, it said the
> B> dll was not a Microsoft .Net Module ...
> B> My project is going to deploy on PocketPC, so that I chose
> B> the one in <sybase 9>\ce\arm.30\
> B> (P.S Actually, there is no difference to select another one
> B> in other files.)
>
> Unfortunately, that component only works on the desktop. It uses
> ActiveX which is not supported in the .Net *Compact* framework.
> --
> David Fishburn
> Certified ASA Developer Version 8
> iAnywhere Solutions - Sybase
> Professional Services
> Please only post to the newsgroup
> Please ALWAYS include version and MORE importantly BUILD number with
> EACH post (dbeng9 -v).
>
> EBFs and Maintenance Releases
> http://downloads.sybase.com/swx/sdmain.stm
>
> Developer Community / Whitepapers
> http://www.ianywhere.com/developer
>
> CaseXpress - to report bugs
> http://casexpress.sybase.com
>
> CodeXchange - Free samples
> [url]http://ianywhere.codexchange.sybase.com/servlets/ ProjectDocumentList[
/url]
>



Billy

2005-11-09, 7:24 am

First of all, thank you for reply ~

Few more questions, if anyone could give me a help.
I have tried the suggested CFCOM, however, I have problem to
make it works on my little Pocket PC!

Here's my C# code:

ComObject.AddLicense(" XXXXXXXXXXXXXXXXXXXX
XXXXXXX");

string path = @"\Program Files\Sybase\ASA9";

string cmd = @"-c "" eng=remote;uid=DBA;p
wd=SQL""";

ComObject dbmlsync = new ComObject ("DbmlsyncCOM.Dbmlsync");

dbmlsync.Invoke("Path", InvokeFlags.SetProperty, path);

dbmlsync.Invoke("Run", InvokeFlags.CallMethod, cmd);

After above "Run" method, it shows nothing! At least,
expected, should show me something wrong.

Does anyone make it works just similar to my case?
Thanks for point me out what's wrong with it!



> I have heard of people who have been successful in running
> ActiveX components using the .NET Framework using third
> party tools. I believe one of them is Odyssey Software
> CFCOM
>
>

http://msdn.microsoft.com/library/d.../html/cfcom.asp
>
> --
> Liam Cavanagh
> Sr. Product Manager
> Certified ASA Developer Version 8
> iAnywhere
> "David Fishburn" <fishburn_spam@off.ianywhere.com> wrote
> in message
> of sybase.public.sqlanywhere.mobilink: >
>

[url]http://ianywhere.codexchange.sybase.com/servlets/ ProjectDocumentList[
/url]
>
>

Billy

2005-11-09, 7:24 am

First of all, thank you for reply ~

Few more questions, if anyone could give me a help.
I have tried the suggested CFCOM, however, I have problem to
make it works on my little Pocket PC!

Here's my C# code:

ComObject.AddLicense(" XXXXXXXXXXXXXXXXXXXX
XXXXXXX");

string path = @"\Program Files\Sybase\ASA9";

string cmd = @"-c "" eng=remote;uid=DBA;p
wd=SQL""";

ComObject dbmlsync = new ComObject ("DbmlsyncCOM.Dbmlsync");

dbmlsync.Invoke("Path", InvokeFlags.SetProperty, path);

dbmlsync.Invoke("Run", InvokeFlags.CallMethod, cmd);

After above "Run" method, it shows nothing! At least,
expected, should show me something wrong.

Does anyone make it works just similar to my case?
Thanks for point me out what's wrong with it!

Regards,

Billy

> I have heard of people who have been successful in running
> ActiveX components using the .NET Framework using third
> party tools. I believe one of them is Odyssey Software
> CFCOM
>
>

http://msdn.microsoft.com/library/d.../html/cfcom.asp
>
> --
> Liam Cavanagh
> Sr. Product Manager
> Certified ASA Developer Version 8
> iAnywhere
> "David Fishburn" <fishburn_spam@off.ianywhere.com> wrote
> in message
> of sybase.public.sqlanywhere.mobilink: >
>

[url]http://ianywhere.codexchange.sybase.com/servlets/ ProjectDocumentList[
/url]
>
>

Tim

2005-11-09, 8:24 pm

I tried CFCOM with no luck. So I wrote my own using OpenNETCF.org's API's.

Have you considered using UltraLite? It's all in their ADO.NET API. I would
have gone that way if it wasn't for the 64K row limit.

Otherwise, here's how I did it with ASA on the Pocket PC:

args is the connection string, etc... yours can be simpler than this
string args = "-c \"ENG=" + dbn + ";DBN=" + dbn + ";UID=DBA;PWD=*****\" -ap
\"" + this.UserName + "\" -e \"adr=" + singleQuote + "host=" +
this.ServerName + port + singleQuote + ";ctp=" + this.Protocol +
";sv=v1\" -o" + logTruncate + " \"" + System.IO.Path.Combine(this.DBPath,
this.LogFileName) + "\" -vnosu" + logRows + " -k -x -d";

public int Sync(string args, int timeoutMinutes)
{
// Default to error code, zero being success.
int retVal = -888;
int timeout = timeoutMinutes * 60 * 1000; // convert minutes to
milliseconds

// Location of sync engine executable file
String fullAppName =
System.Reflection.Assembly. GetExecutingAssembly
().GetName().CodeBase;
string dbmlsyncExe =
System.IO.Path.Combine(System.IO.Path. GetDirectoryName(ful
lAppName),
"dbmlsync");
dbmlsyncExe = @"\Program Files\Sybase\ASA9\db
mlsync.exe";

// Start sync process
OpenNETCF.Diagnostics.ProcessStartInfo psi = new
OpenNETCF.Diagnostics. ProcessStartInfo(dbm
lsyncExe, args);
psi.UseShellExecute = false;
OpenNETCF.Diagnostics.Process process = null;
process = OpenNETCF.Diagnostics.Process.Start(psi);
process.Exited += new EventHandler(process
_Exited);

// Wait until process exits. Timeout should be enough to have it make
// sense to kill process if it expires.
bool exited = process. WaitForExit(timeout)
;

if (exited)
retVal = process.ExitCode;
else
{
try
{
process.Kill();
}
catch {}
throw new
MY. SynchronizationExcep
tion(SL.ResourceText.GetString(MY.ResourceKeyIndex.SY
NC_UNEXPECTED_ERROR)
);
}
return retVal;
}

This only gives you a pass/fail return value, no other real useful
information.

For usefull error handling or processing (somewhat limited), you'll need to
use sp_hook procedures, put their output into a table and read that table
when you get a fail from the above method. Read up on the sp_hook's in the
docs.

Tim


Billy

2005-11-10, 3:24 am

UltraLite may not be the best in my application.

You code works! I can start dbmlsyc.exe in my application
now.

Thanks a lot!

Billy : )

> I tried CFCOM with no luck. So I wrote my own using
> OpenNETCF.org's API's.
>
> Have you considered using UltraLite? It's all in their
> ADO.NET API. I would have gone that way if it wasn't for
> the 64K row limit.
>
> Otherwise, here's how I did it with ASA on the Pocket PC:
>
> args is the connection string, etc... yours can be simpler
> than this string args = "-c \"ENG=" + dbn + ";DBN=" + dbn
> + ";UID=DBA;PWD=*****\" -ap \"" + this.UserName + "\" -e
> \"adr=" + singleQuote + "host=" + this.ServerName + port +
> singleQuote + ";ctp=" + this.Protocol + ";sv=v1\" -o" +
> logTruncate + " \"" + System.IO.Path.Combine(this.DBPath,
> this.LogFileName) + "\" -vnosu" + logRows + " -k -x -d";
>
> public int Sync(string args, int timeoutMinutes)
> {
> // Default to error code, zero being success.
> int retVal = -888;
> int timeout = timeoutMinutes * 60 * 1000; // convert
> minutes to milliseconds
>
> // Location of sync engine executable file
> String fullAppName =
> System.Reflection.Assembly. GetExecutingAssembly
().GetName(
> ).CodeBase;
> string dbmlsyncExe =
> System.IO.Path.Combine(System.IO.Path. GetDirectoryName(ful

> lAppName), "dbmlsync");
> dbmlsyncExe = @"\Program
> Files\Sybase\ASA9\db
mlsync.exe";
>
> // Start sync process
> OpenNETCF.Diagnostics.ProcessStartInfo psi = new
> OpenNETCF.Diagnostics. ProcessStartInfo(dbm
lsyncExe, args);
> psi.UseShellExecute = false;
> OpenNETCF.Diagnostics.Process process = null;
> process = OpenNETCF.Diagnostics.Process.Start(psi);
> process.Exited += new EventHandler(process
_Exited);
>
> // Wait until process exits. Timeout should be enough
> to have it make
> // sense to kill process if it expires.
> bool exited = process. WaitForExit(timeout)
;
>
> if (exited)
> retVal = process.ExitCode;
> else
> {
> try
> {
> process.Kill();
> }
> catch {}
> throw new
> MY. SynchronizationExcep
tion(SL.ResourceText.GetString(MY.R
> esourceKeyIndex.SY NC_UNEXPECTED_ERROR)
);
> }
> return retVal;
> }
>
> This only gives you a pass/fail return value, no other
> real useful information.
>
> For usefull error handling or processing (somewhat
> limited), you'll need to use sp_hook procedures, put their
> output into a table and read that table when you get a
> fail from the above method. Read up on the sp_hook's in
> the docs.
>
> Tim
>
>

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