Problem reading all data from Synchronous Socket

Hi,
I have the task to implements an C# application which communicates with a SAP system via HTTP. My application should act as a HTTP Server to the SAP system. SAP sends documents (PDFs, Word-Docs, Tifs) through HTTP-Requests to my Server. Archive Link is SAP´s name for that HTTP interface.
Currently I am using synchronous sockets to process the communication. So
basically I do something like this:
        Thread th = new Thread(new ThreadStart(StartListenThreaded));
     th.Start();
The method StartListenThread looks like this:
     private void StartListenThreaded()
               IPAddress ipAddress = IPAddress.Parse("127.0.0.1");
               IPEndPoint EndPoint = new IPEndPoint(ipAddress, port);
               Socket ss = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
               ss.Bind( EndPoint);
               ss.Listen(20);
               try
                    while(true)
                         Console.WriteLine("rnServer is waiting for a new connection..rn");
                         Socket sock = ss.Accept();
                         Console.WriteLine("Accepted connection form:"+sock.RemoteEndPoint);
                         Connection con = new Connection(sock);
                         Thread t = new Thread(new ThreadStart(con.ProcessOneRequest));
                         t.IsBackground=true;
                         t.Priority=ThreadPriority.BelowNormal;
                         t.Start();
               catch (System.Exception e1)
               {  Console.WriteLine("An Exception Occurred while Listening :" +e1.ToString()); }
As mentioned above There are mostly some Word-Documents or PDF files send as the body of a request. So I need to parse the body and write the content to a file.
Currently I use this code to accomplish that:
     while (true)
         if(socket.Available == 0)
          break;
            n = socket.Receive(bytes);
         if(n == 0)
           break;
         wr.Write(bytes,0,n); // wr is a BinaryWriter
Now my problem is that this loop breaks before all data is received from the socket. That means it runs into the socket.Available == 0 case and ends, but there is still data available. How did I find that out? Well during debugging the code.
With the debugger running and when stepping through the code, obviously leaves the SAP side more time to send its data.
When doing some Console.WriteLine() after the loop with the socket.Receive() I get results > 0. So there is still data available.
I am not asking an SAP question here. I am aware that the problem could also be on the SAP side. However I think it is a C# issue. Has anyone experienced similar problems with sockets? Am I doing something completely wrong in handling my socket? I also don´t think that I can use Asynchronous sockets beacuse I need to process incoming requests in a determined order.
I have also tryed to turn off Blocking mode by setting socket.Blocking = false but I found out that I cannon use that because I need NetworkStream at some point in my application and NetworkStream does not work without blocking mode.

I have evaluated several other possibilities before starting to implement HTTP on a socket basis. I only have this choice.
I have had a detailed look at Cassini before, but since you mentioned it in your post I looked at it more closely and I think I found a solution for my Problem.
Cassini uses some code like the following to poll for more data in a request. I am now using this mechanism in my application and it works fine.
          private int WaitForRequestBytes()
               int availBytes = 0;
               try
                    Console.WriteLine("socket.Available: " + socket.Available);
                    if (socket.Available == 0)
                         // poll until there is data
                         Console.WriteLine("Polling 100ms");
                         socket.Poll(100000 /* 100ms */, SelectMode.SelectRead);
                         if (socket.Available == 0 && socket.Connected)
                              Console.WriteLine("Polling 1sec");
                              socket.Poll(1000000 /* 1sec */, SelectMode.SelectRead);
                              // socket.Poll(10000000 /* 10sec */, SelectMode.SelectRead);
                    availBytes = socket.Available;
               catch
               return availBytes;
So thanks for putting me in the right direction.
Mirco

Similar Messages

  • Reading int data from a socket

    Hi!
    I'm new here and I have a question. I'm reading bytes from a socket and I'm trying to get some integers from a byte array. But I have a problem. I'm able to read the byte array but i can't get correct int numbers from it. For example i have a byte array with following bytes:
    10004000-82-72-109-84
    When I read those int's with, for example DataInputStream.readInt() first two numbers i get are 16777216 and 67108864 but I know they should be 1 and 4. I know because this is what server sends and I get this reading data in some other languages for example C or even PHP. I even tried using ByteBuffer but with same wrong result. Maybe it has something to do with little/big endian or something, I don't know. Maybe somebody could tell me how to get correct numbers. Maybe I should do it other way than reading byte array... I have no idea... :(
    Thanks!

    If you cannot change the transmitting application,
    you'll have to compensate in your Java application
    by using ByteBuffer in backward-endian mode.Well... I cannot change the transmitting application. Simply, I have no acces to it. I tried with using ByteBuffer with LITTLE_ENDIAN order and it worked. Thanks!

  • Encoding problem while reading binary data from MQ-series

    Dear all,
    we are running on 7.0 and we have an encoding problem while reading binary data from MQ-series. Because we are getting flat strings from queue we use module "Plain2ML" (MessageTransformBean) for wrapping xml-elements around the incoming data.
    The MQ-Series-Server is using CCSID 850, which we configured in connection parameters in communication channel (both parameters for Queuemanager CCSID and also CCSID of target).If there are special characters in the message (which HEX-values differ from codepage to codepage) we get errors in our adapter while executing, please see stack-trace for further analysis below.
    It seems to us that
    1. method ByteToCharUTF8.convert() expects UTF-8 in binary data
    2. Both CCSID parameters are not used anyway in JMS-adapter
    How can we solve this problem without changing anything on MQ-site?
    Here is the stack-trace:
    Catching com.sap.aii.af.mp.module.ModuleException: Transform: failed to execute the transformation: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException caused by: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException
        at com.sap.aii.af.modules.trans.MessageTransformBean.throwModuleException(MessageTransformBean.java:453)
        at com.sap.aii.af.modules.trans.MessageTransformBean.process(MessageTransformBean.java:387)
        at com.sap.aii.af.mp.module.ModuleLocalLocalObjectImpl0_0.process(ModuleLocalLocalObjectImpl0_0.java:103)
        at com.sap.aii.af.mp.ejb.ModuleProcessorBean.process(ModuleProcessorBean.java:292)
        at com.sap.aii.af.mp.processor.ModuleProcessorLocalLocalObjectImpl0_0.process(ModuleProcessorLocalLocalObjectImpl0_0.java:103)
        at com.sap.aii.adapter.jms.core.channel.filter.SendToModuleProcessorFilter.filter(SendToModuleProcessorFilter.java:84)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.ConvertBinaryToXiMessageFilter.filter(ConvertBinaryToXiMessageFilter.java:304)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.ConvertJmsMessageToBinaryFilter.filter(ConvertJmsMessageToBinaryFilter.java:112)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.InboundDuplicateCheckFilter.filter(InboundDuplicateCheckFilter.java:87)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.TxManagerFilter.filterSend(TxManagerFilter.java:123)
        at com.sap.aii.adapter.jms.core.channel.filter.TxManagerFilter.filter(TxManagerFilter.java:59)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.DynamicConfigurationFilter.filter(DynamicConfigurationFilter.java:72)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.PmiAgentFilter.filter(PmiAgentFilter.java:66)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.InboundCorrelationFilter.filter(InboundCorrelationFilter.java:60)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.JmsHeadersProfileFilter.filter(JmsHeadersProfileFilter.java:59)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageInvocationsFilter.filter(MessageInvocationsFilter.java:89)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.JarmMonitorFilter.filter(JarmMonitorFilter.java:57)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.filter.ThreadNamingFilter.filter(ThreadNamingFilter.java:62)
        at com.sap.aii.adapter.jms.core.channel.filter.MessageFilterContextImpl.callNext(MessageFilterContextImpl.java:195)
        at com.sap.aii.adapter.jms.core.channel.SenderChannelImpl.doReceive(SenderChannelImpl.java:263)
        at com.sap.aii.adapter.jms.core.channel.ChannelImpl.receive(ChannelImpl.java:437)
        at com.sap.aii.adapter.jms.core.connector.MessageListenerImpl.onMessage(MessageListenerImpl.java:36)
        at com.ibm.mq.jms.MQMessageConsumer$FacadeMessageListener.onMessage(MQMessageConsumer.java:399)
        at com.ibm.msg.client.jms.internal.JmsMessageConsumerImpl$JmsProviderMessageListener.onMessage(JmsMessageConsumerImpl.java:904)
        at com.ibm.msg.client.wmq.v6.jms.internal.MQMessageConsumer.receiveAsync(MQMessageConsumer.java:4249)
        at com.ibm.msg.client.wmq.v6.jms.internal.SessionAsyncHelper.run(SessionAsyncHelper.java:537)
        at java.lang.Thread.run(Thread.java:770)
    Caused by: com.sap.aii.messaging.adapter.trans.TransformException: Error converting Message: 'sun.io.MalformedInputException'; nested exception caused by: sun.io.MalformedInputException
        at com.sap.aii.messaging.adapter.Conversion.service(Conversion.java:714)
        at com.sap.aii.af.modules.trans.MessageTransformBean.processTransform(MessageTransformBean.java:538)
        at com.sap.aii.af.modules.trans.MessageTransformBean.processTransform(MessageTransformBean.java:528)
        at com.sap.aii.af.modules.trans.MessageTransformBean.processTransform(MessageTransformBean.java:471)
        at com.sap.aii.af.modules.trans.MessageTransformBean.process(MessageTransformBean.java:364)
        ... 36 more
    Caused by: sun.io.MalformedInputException
        at sun.io.ByteToCharUTF8.convert(ByteToCharUTF8.java:270)
        at sun.nio.cs.StreamDecoder$ConverterSD.convertInto(StreamDecoder.java:287)
        at sun.nio.cs.StreamDecoder$ConverterSD.implRead(StreamDecoder.java:337)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:223)
        at java.io.InputStreamReader.read(InputStreamReader.java:208)
        at java.io.BufferedReader.fill(BufferedReader.java:153)
        at java.io.BufferedReader.readLine(BufferedReader.java:316)
        at java.io.LineNumberReader.readLine(LineNumberReader.java:176)
        at com.sap.aii.messaging.adapter.Conversion.convertPlain2XML(Conversion.java:310)
        at com.sap.aii.messaging.adapter.Conversion.service(Conversion.java:709)
        ... 40 more
    Any ideas?
    Kind regards, Stefan

    Hi Stefan,
    for the first MTB now we are using only one parameter: Transform.ContentType = text/plain;charset="ISO-8859-1"
    The second MTB, which does the XML-Wrapping, is configured like this:
    Transform.Class = com.sap.aii.messaging.adapter.Conversion
    Transform.ContentType = application/xml
    xml.conversionType = SimplePlain2XML
    xml.fieldNames = value
    xml.fieldSeparator = §%zulu§%
    xml.processFieldNames = fromConfiguration
    xml.structureTitle = payload
    Both CCSID configuration parameters from the "Source"-Tab we've set to 850.
    Now, we don't get an error anymore - sun.io.malformedInputException - , but, unfortunately, now special character conversion succeeded (we need an "ß" and we get an ISO-HEX-E1 -> á).  E1 is (different from ISO) an "ß" in 850.
    Any ideas?

  • Fetching all data from MS access PROBLEM !!!

    Hi all,
    I am having problem of fetching all data from MS ACCESS, ie, I have 112 rows of data, yet when executing query SELECT * ... only 70 items are retrieved. Don't know why, but the retrieval prcess stops on item 69 and want get the rest of the data.
    I am executing the query in a WHILE loop, don't specify the number of loops !!! so I should be able to get all of the data. Why then I always only get 69?
    Second q.
    What is the right SYNTAX for retrieving specific data. ie. SELECT id from images WHERE size = 58
    is this correct? ie. size is declared as number?
    ANy help would be much appreciated.
    Thanks

    1. Where from you are fetching the data? Is it from bean or JSP or servlet? Can you post the code?
    2. Yes. the sql syntax is correct.

  • I use LabVIEW 7.1 but I have some problem when, I use LabVEW to read the data from serial communication

    I use LabVIEW 7.1 but I have some problem when, I use LabVEW to read the data from serial communication.
    I use LabVIEW to read the data from serial communication then, i open the example (.vi) from Serial Communication - Advanced Serial Write and Read  from LabVIEW Example. BUT it have some error message that : Error - 1073807202 occured  at property node in visa configure serial port (instr).vi -> advance serial write and read .vi
    this error code is undefined. no one has provide a description for this code, or you might have wired a number that is not an error code to the error code input.
    I don't know why? please help me. thank you.

    When I copy that code into "Explain Error" I get: "VISA:  (Hex 0xBFFF009E) A code library required by VISA could not be located or loaded."
    You may have a bad install of VISA or the wrong version of VISA loaded. Try re-installing VISA. You can get the latest version from the NI support site: http://digital.ni.com/softlib.nsf/webcategories/85256410006C055586256BBB002C0E91?opendocument&node=1....
    Also ensure that you are not pointing the example towards a serial port that does not exist.
    Please let us know what you find and what gets this working for you.
         Rob

  • How to read the data from Excel file and Store in XML file using java

    Hi All,
    I got a problem with Excel file.
    My problem is how to read the data from Excel file and Store in XML file using java excel api.
    For getting the data from Excel file what are all the steps i need to follow to get the correct result.
    Any body can send me the code (with java code ,Excel sheet) to this mail id : [email protected]
    Thanks & Regards,
    Sreenu,
    [email protected],
    india,

    If you want someone to do your work, please have the courtesy to provide payment.
    http://www.rentacoder.com

  • Regarding reading the data from the files without using Stremas

    hai to all of u...
    here i have a problem where i have to read the data from the files without using any streams.
    please guide me how to do this one,if possible by giving with an example
    Thanks & Regard
    M.Ramakrishna

    Simply put, you can't.
    By why do you need to?

  • Reading the data from network card

    Hi,
    java.net defines the class NetworkInterface. Currently there are two network cards, one is wireless and another is for LAN.I am able to retrive their names and IP addresses using NetworkInterface methods.How to read the data from a specifc network card? Can we read all TCP packets which are passed through network card?
    using socket?
    Regards
    prasanna

    pdiwadkar wrote:
    Hi,
    java.net defines the class NetworkInterface. Currently there are two network cards, one is wireless and another is for LAN.I am able to retrive their names and IP addresses using NetworkInterface methods.How to read the data from a specifc network card? Can we read all TCP packets which are passed through network card?
    using socket?
    Regards
    prasannaYou may already know that Java is not good at doing some 'low level stuff'.
    You cannot use (pure) Java to access the raw network data.

  • Problem in passing data from 1 screen to another using BBP_DOC_CHANGE_BADI.

    Hi Experts,
    i am new to the SRM, i am facing problem in passing data from one screen to another.
    my requirement is that when we select one shopping cart and press the PROPOSE SOURCES OF SUPPLY button, we will fetch all the contracts that are attached to the shopping cart.
    we have implemented a BADI implementation of BBP_SOS_BADI (method BBP_SOS_CHECK) for passing some changed values to the contracts of the shopping cart into the popup screen that is displayed when we press PROPOSE SOURCES OF SUPPLY button and when we select any contract and press ASSIGN ONLY button in the popup screen the badi BBP_DOC_CHANGE_BADI is triggered.
    i have implemented another BADI implementation of BBP_DOC_CHANGE_BADI for fetching the selected contract and pass the values to another screen, but the problem is that when we select one contract and press the assign only button we are fetching the wrong contract number ( that is in the BADI method BB_SC_CHANGE parameter IT_ITEM we are fetching the wrong contract), if we again do the same procedure for the second time we are getting the correct contract.
    i am unable to understand why we are getting the wrong contract in the first time( that is we are getting contract other than the selected one).
    as per my understanding i think when we are passing data to the popup screen using BBP_DOC_CHANGE_BADI we are not updating the shopping cart with the changed data.
    can anyone tell me how we can update the SHOPPING CART with the changed contracts data, i have used BBP_PD_SC_UPDATE, BBP_PD_SC_SAVE and other shopping cart FM but nothing is happening.
    Thanks
    Tanveer

    Hello,
    What version of SRM are you on?  Have you check for OSS Notes?  I have had trouble with BBP_DOC_CHANGE_BADI but it was because of other issues.  The BADI works pretty well and it is called almost every time something happens to the shopping cart.
    I have noticed that sometimes that values are not changed til the second calling of the BADI.  I have yet understand why but I think it has to do with prompt processing. Usually, we train our requisitioners to click the 'Check'  button to flush things out.
    I don't know if I was helpful.... another thought.... could there be an error caught by BBP_DOC_CHECK_BADI that is preventing change in BBP_DOC_CHANGE_BADI?
    Regards, Dean.

  • Reading XML data from .pages file

    Hi All!
    I've been trying to get a script up and running, but frankly I'm lost. The script should read the date, lesson no, and name fields from a .pages file and then use that information to send an e-mail.
    What I'm having a problem with is reading the data from the .pages file and I don't know what the best way to do it is because I'm still a novice at this.
    So there are two ways I can think of:
    1. Read directly from the Pages document when it is open. The problem with this is that it's a Pages template and it contains tables. Perhaps the easiest thing would be just to select certain cells directly from pages, but I have no idea how they're labeled or how to access them so I came up with a second idea. If you happen to know how to do this, I would greatly appreciate it.
    2. Pages documents can be unzipped and one of the files is an xml file with a lot of tags and the data I need. I found the following post that talks about how to parse XML via an XSL stylesheet. After going through some tutorials, I got stuck because the xml itself in the Pages file is just a mess to me and I'm confused about which node to choose. In other xml docs you can see a clear, nicely laid out tabbed structure so you can at least figure out the path to the node you want. I stumbled across a nice script for TextWrangler which cleans up XML, but it just barks at the Pages file.
    3. On top of that, I will need to use the name field and match that with an Address Book e-mail address. Should I change the template and make it into an address book field?
    Thanks in advance,
    Paul

    The script should read the date, lesson no, and name fields from a .pages file and then use that information to send an e-mail.
    Maybe you might want to try the following script:
    tell application "Pages"
        activate
        tell foreground layer of page 1 of front document
            select (text box 1 whose vertical position < 0.5)
            tell application "System Events"
                keystroke "c" using {command down} -- ⌘C
                keystroke "a" using {shift down, command down} -- ⇧⌘A
            end tell
            set theText to the clipboard
        end tell
    end tell
    set TID to AppleScript's text item delimiters
    set AppleScript's text item delimiters to tab
    set theTextFields to text items of theText
    set AppleScript's text item delimiters to TID
    set {theDate, theLessonNo, theStudent} to {item 2, item 4, item 6} of theTextFields

  • Raw Read Error Rate, Errors occurred while reading raw data from a disk

    hi
    when I turn my pavilion dv6 2170ee computer on screen shows below error.
    system diognostics (F2) does not any work
    and when my windows7 comming up this error was shown.
    I install Hard Disk Sentinel software and this program shows below:
    Failure Predicted - Attribute: 1 Raw Read Error Rate, Errors occurred while reading raw data from a disk. Indicate problem with the disk surface or the read/write heads.
    There are 28 weak sectors found on the disk surface. They may be remapped any time in the later use of the disk.
    26848 errors occured during data transfer. This may indicate problem of the device or with data/power cables. It is recommended to examine and replace the cables if possible.
    Replace hard disk immediately.
    how can I fix it?
    may drive format (Fdisk) and renewing windows can fix it?
    tanx and regards
    Mohammad

    Hello mohkhosh,
    I see that you're getting an error indicating possible hard driver failure, that you have this message from 3 different sources. I will try to help you with this.
    After reviewing everything  you're looking at needing to replace the hard drive. I would suggest contacting support to see what they can do for you.
    HP Technical Support, North America 1-800-474-6836. For all other regions click here.
    Thank you for posting on the HP Forums.
    I worked on behalf of HP.

  • Problems with retrieving data from tables with 240 and more records

    Hi,
    I've been connecting to Oracle 11g Server (not sure exact version) using Oracle 10.1.0 Client and O10 Oracle 10g driver. Everything was ok.
    I installed Oracle 11.2.0 Client and I started to have problems with retrieving data from tables.
    First I used the same connection string, driver and so on (O10 Oracle 10g) then I tried ORA Oracle but with no luck. The result is like this:
    I'm able to connect to database. I'm able to retrieve data but from small tables (e.g. with 110 records it works perfectly using both O10 and ORA drivers). When I try to retrieve data from tables with like 240 and more records retrieval simply hangs (nothing happens at all - no error, no timeout). Application seems to hang forever.
    I'm using Powerbuilder to connect to Database (either PB10.5 using O10 driver or PB12 using ORA driver). I used DBTrace, so I see that query hangs on the first FETCH.
    So for the retrievals that hang I have something like:
    (3260008): BIND SELECT OUTPUT BUFFER (DataWindow):(DBI_SELBIND) (0.186 MS / 18978.709 MS)
    (3260008): ,len=160,type=DECIMAL,pbt=4,dbt=0,ct=0,prec=0,scale=0
    (3260008): ,len=160,type=DECIMAL,pbt=4,dbt=0,ct=0,prec=0,scale=1
    (3260008): ,len=160,type=DECIMAL,pbt=4,dbt=0,ct=0,prec=0,scale=0
    (3260008): EXECUTE:(DBI_DW_EXECUTE) (192.982 MS / 19171.691 MS)
    (3260008): FETCH NEXT:(DBI_FETCHNEXT)
    and this is the last line,
    while for retrievals that end, I have FETCH producing time, data in buffer and moving to the next Fetch until all data is retrieved
    On the side note, I have no problems with retrieving data either by SQL Developer or DbVisualizer.
    Problems started when I installed 11.2.0 Client. Even if I want to use 10.0.1 Client, the same problem occurs. So I guess something from 11.2.0 overrides 10.0.1 settings.
    I will appreciate any comments/hints/help.
    Thank you very much.

    pgoel wrote:
    I've been connecting to Oracle 11g Server (not sure exact version) using Oracle 10.1.0 Client and O10 Oracle 10g driver. Everything was ok.Earlier (before installing new stuff) did you ever try retrieving data from big tables (like 240 and more records), if yes, was it working?Yes, with Oracle 10g client (before installing 11g) I was able to retrieve any data, either it was 10k+ records or 100 records. Installing 11g client changed something that even using old 10g client (which I still have installed) fails to work. The same problem occur no matter I'm using 10g or 11g client now. Powerbuilder hangs on retrieving tables with more than like 240 records.
    Thanks.

  • Database "read all data.vi" not able to read row contents

    Good day,
    I'm trying to read a table from an Excel Database, with the NI VI "Read all data.vi" provided as an example VI.  The VI is slighlty modified to have the file dialog box wired to the open connection VI.  This file dialog provides the connection information to the Excel database.   So far only the column names are showing, but not any row content, as you can see in the screenshot - front_panel.
    What the VI does :
    - finds the table name(s)
    - finds the column name(s)
    Problem with the system:
    - can't read row data.
    The Excel file in question is really really simple.
    here is the content of the dsn file:
    [ODBC]
    DRIVER=Microsoft Excel Driver (*.xls)
    UID=admin
    UserCommitSync=Yes
    Threads=3
    SafeTransactions=0
    ReadOnly=0
    PageTimeout=5
    MaxScanRows=8
    MaxBufferSize=2048
    FIL=excel 8.0
    DriverId=790
    DefaultDir=C:\MPBC\My Database
    DBQ=C:\MPBC\My Database\SIMPLEST.xls
    Any hints on how to get row data?
    Thanks in advance.
    ---info---------
    LabVIEW 8.6
    Excel 9.0  or 2000
    Win XP pro SP3
    FB
     

    Well, as I said, I can't help with treating Excel as a DataBase, but here is some code to read your Excel file.  I actually read it twice, the first time returning all of the data in a single array (you can split it yourself into Header and Data), and the second time I read in a single row into Header (the Read returns a 2D array, which I turn into 1D) and a second Read for the rest of the data.  To read the rest, I first figure out the "next" row (one past the last row, so I decrement it to get the last row) and specify all the columns).  The 100 msec time delay between Excel Reads is to give Excel a chance to "cool down" (trust me, without the Delay, Excel will throw an Error).  Note that this is a Snippet -- you can drag it into a LabVIEW 2014 Block Diagram and it will become LabVIEW code.
    Hmm -- I just noticed that you seem to be using LabVIEW 8.6, more than 5 years old.  I don't know if this version of the RGT is available in that older version.
    Bob Schor

  • When I try to share a project to theater I get the message Your Theater could not be opened.There was a problem reading your movies from iCloud and the project does not share. Can anyone help?

    When I try to share a project to theater I get the message Your Theater could not be opened.There was a problem reading your movies from iCloud and the project does not share. Can anyone help?

    Set up iMovie Theater and iCloud
    In order to take full advantage of the capabilities of iMovie Theater, you must be signed in to iCloud. If you are signed in to iCloud, movies and trailers shared to iMovie Theater are automatically uploaded to iCloud. You can also turn off automatic uploading, and upload just the movies and trailers you want, or delete individual movies and trailers from iCloud. For more information about the Theater, see iMovie Theater overview.
    If you sign out of your iCloud account on your Mac, all iCloud movies disappear from the Theater, but they are not deleted; the movies reappear when you sign in again. If you ever run out of space in iCloud, an alert icon appears in the top-right corner of your movie, indicating that you can’t upload new movies. For more information, click the icon. After you upgrade your iCloud storage or clear space, your movies automatically appear in iCloud again.
    Hide
    Set up automatic iCloud uploading
    Choose Apple menu > System Preferences, and click iCloud.
    Make sure you’re signed in, and then select the Documents & Data checkbox.
    Click the Options button next to Documents & Data.
    Make sure the iMovie checkbox is selected.
    In iMovie, choose iMovie > Preferences.
    Select the “Automatically upload content to iCloud” checkbox.
    To turn off automatic uploading, deselect the checkbox.

  • Reading all files froma  folder

    Hi ,
    Does anyone know how to read the data from all text files in a given folder?
    I mean does text_io recongnises a certain sintax to do this?
    Thanks,
    Sandu

    Well
    I'm having problems initializing a java.lang.String as ora_java.jobject.
    I was able to import in forms my class ,(wich works ok when tested like standalone java class,it returns all the filenames from a folder),a package was generated on the form for it.
    But,I've got to pass it the folder name as a String.
    I've imported java.lang.String as ora_java.jobject,and a package was generated on the form.
    When I try to call string.new('c:\work');
    it won't compile,it says invalid reference to variable String.
    What should I do?Is there any predefined Type in ora_java package for java.lang.String?
    Thanks,
    Sandu

Maybe you are looking for

  • My Blackberry Bluetooth problem

    I recently bought a Blackberry 8800 version 4.2.1.79.... Everything is fine, but when I tired to get a ringtone from someone elses phone from using bluetooth the other phone always says 'service not supported' what is that even mean. Also when I go t

  • 8500 drivers

    HP has done it again the drivers won't install on the new windows 7 32 bit system any one know a work around?

  • Old macbook air dual core 1.4 or 1.6 VS Mac Os X Lion performance

    what are your experience using Mac os X Lion with old mac book air ( dual core 1.4 or 1.6 )

  • Libobk.so --- 0 Bytes

    Hi, i've read the thread about the 0 byte libs but on my system sqlplus complains about the libobk.so which is a symbolic link to libdsbtsh8.so!!! Is there a patch for this lib ?? What did I wrong ? Thank you very much Michael null

  • Using MessageDownload gives a blank page

    Hi all Here is my pb : 1/ Extend a VO oracle.apps.icx.por.wf.server.ReqLinesNotificationsVO to display attachments of requisitions (via fnd_attached_documents fad,fnd_documents_tl fdtl,fnd_lobs fl tables) 2/ Add a Message Download through Personnaliz