Retrieving WinSock data

Hi all,

I'm using the standard ole Windows winsock control SP 4 from windows
but I can not get the data. Where I'm wrong?

client send a string message

in the server on dataarrival event I have written the following:
/////////////////////////////////////////////////////////
string message1
MessageBox("Received: ", string(bytestotal))         // here I receive 26
the length of the sent string

ole_socket.object.getdata( message1 ,8 )               // 8 means vbString
MessageBox("Received: ", message1)                    // there is nothing in
message1
////////////////////////////////////////////////////////////

TIA,
Valentin


0
valentin
3/13/2003 8:47:31 AM
sybase.powerbuilder.general 62418 articles. 14 followers. Follow

4 Replies
578 Views

Similar Articles

[PageSpeed] 30

Hi!

i'm not sure... but i had done something like this sometime back. that 
worked for me. hope it helps u as well.

First check that your OLE object is valid by using something like:

if IsValid(ole_socket) then
  messagebox('ole socket', 'valid object')
else
  messagebox('ole socket', 'invalid object')
  // object not valid, so exit
end if

also, try declaring message1 as any and don't pass the type argument to 
getdata:

any message1
string message2

ole_socket.object.getdata(message1)
message2 = message1
messagebox('data retrieved from winsock', message2)
..
..

HTH
0
RDPaul
3/14/2003 10:40:42 AM
sorry...

the conversion from any to string should be:

message2 = String(message1)
0
RDPaul
3/14/2003 10:42:57 AM
Thx RDPaul,

While retrieving data in variable of type any I received an runtime error.
I have tried also to give the second optional parameter of vbString (with
string variable :)), vbArray.
I still receive nothing.

Maybe other ideea.?

Regards,
Valentin

<RDPaul> wrote in message
news:E90C75B442983D0E003AA85385256CE9.003675DF85256CE8@webforums...
> Hi!
>
> i'm not sure... but i had done something like this sometime back. that
> worked for me. hope it helps u as well.
>
> First check that your OLE object is valid by using something like:
>
> if IsValid(ole_socket) then
>   messagebox('ole socket', 'valid object')
> else
>   messagebox('ole socket', 'invalid object')
>   // object not valid, so exit
> end if
>
> also, try declaring message1 as any and don't pass the type argument to
> getdata:
>
> any message1
> string message2
>
> ole_socket.object.getdata(message1)
> message2 = message1
> messagebox('data retrieved from winsock', message2)
> .
> .
>
> HTH


0
valentin
3/14/2003 2:30:15 PM
In the OCX newsgroup I had posted sample code for sockets that are for
socketwrench, a free sockets activex control.

"valentin" <vcarnei@tgh.ro> wrote in message
news:f8s3Ilj6CHA.261@forums.sybase.com...
> Thx RDPaul,
>
> While retrieving data in variable of type any I received an runtime error.
> I have tried also to give the second optional parameter of vbString (with
> string variable :)), vbArray.
> I still receive nothing.
>
> Maybe other ideea.?
>
> Regards,
> Valentin
>
> <RDPaul> wrote in message
> news:E90C75B442983D0E003AA85385256CE9.003675DF85256CE8@webforums...
> > Hi!
> >
> > i'm not sure... but i had done something like this sometime back. that
> > worked for me. hope it helps u as well.
> >
> > First check that your OLE object is valid by using something like:
> >
> > if IsValid(ole_socket) then
> >   messagebox('ole socket', 'valid object')
> > else
> >   messagebox('ole socket', 'invalid object')
> >   // object not valid, so exit
> > end if
> >
> > also, try declaring message1 as any and don't pass the type argument to
> > getdata:
> >
> > any message1
> > string message2
> >
> > ole_socket.object.getdata(message1)
> > message2 = message1
> > messagebox('data retrieved from winsock', message2)
> > .
> > .
> >
> > HTH
>
>


0
M
3/26/2003 10:40:56 PM
Reply:

Similar Artilces:

Retrieving data from XML Vs Retrieving data direct from DataBase
Hi, I have been reading many books regarding retrieving data from data source. Some says, retrieving data from xml is better than directly from database while others say the opposite. The XML here means the Database will process the data into XML, then we read from there, Any thought on this ? Please advise. Thank You.===================================Don't Quote And Flame Me If I Am Wrong=================================== I'm also interested in answer to this question, comparing the performance of XML versus a SQLdatasource. For example, I have a number of Looku...

When doing Client Apps, retrieve data ad hoc or retrieve all data at start?
Am doing a school assignment making a WinForms app in VB.net. As I have prior experience with ASP.NET (thus I truely understand the importance of performance), I decided to build my assignment using the same idealogy as ASP.Net ( or any web application ), retrieving data (volatile) when I need them and update to the database when I'm done. However, my lecturer adviced to my class to retrieve all the data from the database and store them in the Dataset and do all the changes on the Dataset. Whats worse is that he said to update the database with the values in the dataset when done or progr...

Data Set ---- Data Row ( How to retrieve column data in a array )
Question regarding Dataset in ASP.NET ds = DBFunctions.RunSelect("select * from emp where Userid='" & vUserID & "'") If (ds.Tables(0).Rows.Count > 0) Then Dim dr As DataRow = ds.Tables(0).Rows(0)location= dr("location")  -- this statement only gives me the first locaitonMytable userid          location111              AAA111              BBB111         ...

retrieving data from data reader
the code below works but what i want to do instead of using a datagrid i want to retrieve each value and place it into a label control. how can this be done. Function RetrieveDetails(ByVal employerID As Integer) As System.Data.IDataReader Dim connectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0; Ole DB Services=-4; Data Source=C:\Professional"& _ "Jobs.mdb" Dim dbConnection As System.Data.IDbConnection = New System.Data.OleDb.OleDbConnection(connectionString) Dim queryString As String = "SELECT [Employer].[...

data, data, data
Hello, I need some advice on the best method to keep a database updated in this scenario. I have a local Solomon SQL Server where we keep our inventory. I want to build an application that will be hosted at a remote hosting location which provides a SQL database. I want to build the application to allow clients to access the inventory items and make requests based on the remote SQL data. The order will be sent to our fulfillment department via email; they will fiill the request and ship.  I'm not sure the method to do this while keeping the data current on the remote and the l...

Problems retrieving data from data from ORACLE
Hi everybody, I am using PB 6.5.1, Oracle8i I have some problems of retrieving data from Oracle db. We need create a datawindow from a procedure that is locates in a package,this package has beed tested ok, this procedure has three arguments, two of them are passed in, the rest one is for result out, the execute statements in datawindow as following: "execute package_name.procedure_name;0 argument1 = :varible1,argument2 = :varible2" But when we run this datawindow, the error occurs as following: "wrong number or types of arguments in call to the package" ...

Retrieving Data from two Data Sources. How?
I'm wanting to create a report that will use two data sources. One being a DB2 Table and the other being an Access Table. Can someone please tell me what the best way of doing this would be. My thinking is to use a datastore but I'm not sure. Also would I need to use two seperate Transactions objects and if so do you connect at the same time or how does that work. Thanks. Option 1: In the RetrieveStart() event, code: Return(2). During the retrieve, this will append data with out reseting the datastore. Option 2: Retrieve 2 datastores, then use the Rowscopy() functi...

Retrieve Data from Data Grid Columns
I have a data grid with 4 columns(Static) and N rows(Dynamic).First 3 Columns are read only(View State) and 4th column is a check box. My situation is as below To retrieve 1st column and 2nd column value for the N th row check box clicked. Please Help Thanks in adavance.Senthil Try something like this: for each item as DataGridItem in DataGrid1.Items   if item.ItemType = ListItemType.AlternatingItem Or item.ItemType = ListItemType.Item then      ' Get checkbox      Dim chb as Checkbox = item.Fin...

Error in retrieving numerical data from Oracle 8/8i on mainframe using PowerBuilder 6.5
How do I retrieve numerical column data from Oracle 8/8i database on mainframe platform when using Powerbuilder 6.5? If using O84 driver, all numerical data show up as zero. If using OR8 driver, they are huge numbers. Any tips are appreciated. - Jing Use the O73 driver. You can use the O84 driver, but then you must have PB651 and at least EBF 1264. -- Terry Dykstra (TeamSybase) Please state PB / OS / DB versions in your post. MySybase http://my.sybase.com/mysybase Search Deja: http://www.pfcguide.com/_newsgroups/search.asp <xiaojing_liu@ams.com> wrote in message new...

grid view has some data. how to retrieve that data into databse
I have some data in data grid view has some data. how to retrieve that data into databse   Hi Raghava, I dont know what you really want to achieve? Clarify your question?   Thanks,Mark as answer if this post helpfull to you.Don't be afraid to be wrong; otherwise you'll never be right. HI friends, If you have any questions about data controls , you can check this link : http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/data/default.aspx This is a good place to get start.  Samu ZhangMicrosoft Online Community SupportPlease remember to click “Mar...

How to retrieve the data from the data using the stored procedure?
 Hi All, Can any one let me know "How to retreive the data from the database using the stored procedures". Once we retrieve the data from the database using the stored procedure we need to populate the fetched data into the textboxes of the application. Please let me know "How do I acheive this". And please note this, if I try to fetch the record which does not exists in the database it should throw an exception saying that the record which you are trying to search does not exist Thanks and Regards Sandeep. Hi,sunny For Calling Stored Proc U can re...

How can I retrieve DataValueField While I retrieve data from db?
I using this code to retrieve data to fill dropdownlist :  public void Populate1() {   conn.Open();SqlCommand cmd = new SqlCommand("SSELECT RIS_ID,Risk FROM Risk", conn); conn.Open();SqlDataReader reader = cmd.ExecuteReader(); ;   DropDownList1.DataSource = reader;DropDownList1.DataValueField = "Risk";DropDownList1.DataTextField = "RIS_ID"; DropDownList1.DataBind(); conn.Close(); conn.Dispose(); } Data appear in dropdown list but when I using (Response.Write(DropDownList.SelectedItem.Value);) value appear on page first value...

Retrieving byte data form data base
Hi i stored document file in database.i am retrieve that document from data base it's get error.i am using ObjectDatasource. i am Accessing throught Storedprocedure and i am to know convertion of this document in main format.. can any help me on that issue.. thanks Rambhopal reddyRegards Rambhopal Reddy EPlease remember to click “Mark as Answer” on the post that helps you, and to click “Unmark asAnswer” if a marked post does not actually answer your question. Hi, I'd like to know how you store and get the document file in your database. Are you converting it into a byte array, and ...

Retrieving data and writing data in xml format
I am able to retrieve data from a single recordset and output to an xml format, but need to retrieve data from a number of tables with the tables having both 1 to 1 and 1 to many relationships.  I guess I could start at the top and work my way down with while not eof etc and write/append each xml data like, but I'm sure this is really inefficient.  Are there any more efficient tools/methods that allow writing xml data for non flat structures?Many thanks,James Knight What database are you using?  I tend to use the database tools to generate the XML for complex queries, it...

Web resources about - Retrieving WinSock data - sybase.powerbuilder.general

Mother of three killed landlord after he tried to stop her retrieving her son's shirt
A mother of three has been found guilty of killing her landlord after he tried to stop her retrieving a red polo shirt her son needed for school ...

Retrieving bodies a 'horrifying' experience (01:43)
Anti-jump measures on the Story Bridge should be "fast tracked" and water police funding increased so CityCats don't have to pick up bodies. ...

Man drowns retrieving toy boat
A man has drowned after entering the Wimmera River at Horsham to retrieve a remote-controlled boat.

Bishop says there is no time limit on retrieving MH17 remains
THE Australian Federal Police have warned that it is too dangerous to approach the MH17 crash site in war-torn eastern Ukraine until security ...

Search underway for man swept away in Brisbane River while retrieving toy boat
A search is underway for a man swept away in the Brisbane River while retrieving a toy boat.

DPRK blames US for suspension of retrieving American soldiers' remains
DPRK blames US for suspension of retrieving American soldiers' remains People's Daily Online PYONGYANG, Oct. 13 The Democratic People's Republic ...

Good dog: Yankee retrieving a big Canada in a Manitoba hayfield
Good dog: Yankee retrieving a big Canada in a Manitoba hayfield

iPhone dev: Retrieving user phone numbers
... a secret to recovering user phone numbers that does not involve the … One of the most common questions I get these days has to do with retrieving ...

Girl stuck in Dover storm drain retrieving phone
A teenage girl gets stuck in a storm drain in Dover while trying to retrieve her mobile phone which had fallen into it.

Forensic investigations: Retrieving data from the cloud
... ensure that nothing is missed in the evidence gathering process, and to ensure that the investigative team doesn’t run out of time when retrieving ...

Resources last updated: 12/19/2015 3:25:51 AM