Onega

a lot of VC++ posts, a few C# posts, and some miscellaneous stuff

Sunday, June 26, 2005

steps to run calc sample of gSOAP

steps to build the calc server:
compile the header to generate stubs with soapcpp2.exe
D:\3rd\gsoap-win32-2.7\soapcpp2.exe D:\3rd\gsoap-win32-2.7\samples\calc\calc.h
create an empty VC project, rename calcserver.c to calcserver.cpp, add calc.h, calcserver.cpp, soapC.cpp, soapServer.cpp,stdsoap2.cpp to this project.
add a line to calcserver.cpp #pragma comment(lib,"wsock32.lib")
add path of stdsoap2.h to include directory of the project.
build the project.
start the server:
calcserver 1010


steps to build the cacl client:
compile the header to generate stubs with soapcpp2.exe
D:\3rd\gsoap-win32-2.7\soapcpp2.exe D:\3rd\gsoap-win32-2.7\samples\calc\calc.h
create an empty VC project, rename calcclient.c to calcclient.cpp, add calc.h, calcclient.cpp, soapC.cpp, soapClient.cpp,stdsoap2.cpp to this project.
add a line to calcclient.cpp #pragma comment(lib,"wsock32.lib")
add path of stdsoap2.h to include directory of the project.
modify server string in calcclient.cpp
const char server[] = "http://127.0.0.1:1010/calcserver";
build the project.
start the client
calcclient add 1 2
start the client

Tuesday, June 07, 2005

javascript get RecordsAffected from ADO

var adoConnection = WScript.CreateObject("ADODB.Connection");
var adConnectUnspecified = -1;
var adCmdText = 1;
var adExecuteNoRecords = 128;
adoConnection.Open("Provider=SQLOLEDB;"
+"Server=(local);"
+"Database=test;"
+"Trusted_Connection=No;"
,"aa" // UID
,"12345" //PWD
,adConnectUnspecified);
var RecordsAffected ;
var sql = "Update Users set lockout = 0, password = N'" + "someone" + "' where UserName = N'" + "someone" + "'";
var rs_tmp = WScript.CreateObject("ADODB.Recordset");
adoConnection.Execute(sql,
RecordsAffected,
adExecuteNoRecords );
sql = "Select @@ROWCOUNT as row_count";
rs_tmp = adoConnection.Execute(sql,
RecordsAffected,
adCmdText );
RecordsAffected=rs_tmp("row_count").Value;
rs_tmp.Close();
rs_tmp = null;
adoConnection.Close();