Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2008
    Posts
    29

    Red face Unanswered: Error executing SQL code in While Loop (Was "Help Needed")

    Hi all,
    I need one help please. I prepared one command out side the while loop. And i am executing the prepared query in the while loop through front end. And i am committing in the while loop through front end only.After the commit the cursor again going to select execute command. At that time i am getting error as :[Microsoft][ODBC Driver Manager] Function sequence error. Can any one help me how to rectify this error. I came to know why the error coming. Because i am trying to execute the command after coming. But i need to do this. Previously i used SQLBASE. In that i used "DBP_PRESERVE" that problem has gone. But here how to do. I am new to this.

    I need urgently please.
    Thanks in advance.

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Hi

    Please can you supply the code?

    Also, for your sake and mine, please use a descriptive title. Every single thread on here could have "Help Needed!!" as a title - there is no indication of what the problem actually is.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    Mar 2008
    Posts
    29

    Error executing SQL code in While Loop (Was "Help Needed")

    Hi,
    Code means that is fronend code. I am front end as Gupta sqlwindows.

    I am sending it.


    Set sSelectParty = "SELECT DISTINCT S_PARTY, P_NAME WHERE S_PARTY = P_CODE AND S_BILL_NO IS NULL "
    Call SqlPrepareAndExecute( hSqlParty, sSelectParty )
    While SqlFetchNext( hSqlParty, nFetch )
    Set cmbParty = sPartyCode
    Set cmbPartyName = sPartyName
    Call SalWaitCursor( TRUE )
    Call fnSendMsgToForm( PM_Populate )
    Call SqlCommit(hSqlParty)
    Call SalWaitCursor( FALSE )

    Can u help Please.

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    I'm afraid I can't. There are loads of custom function calls there. What is hSQLParty? Where does it actually error? Did you write all the code or have you inherited an application?
    Testimonial:
    pootle flump
    ur codings are working excelent.

  5. #5
    Join Date
    Mar 2008
    Posts
    29
    Hi Pootle,
    Don't afraid. I will tell clearly.

    Query --> "SELECT DISTINCT S_PARTY, P_NAME WHERE S_PARTY = P_CODE AND S_BILL_NO IS NULL " -----> Select Command
    Call SqlPrepareAndExecute( hSqlParty, sSelectParty ) ---> Preparing Select Query
    While SqlFetchNext( hSqlParty, nFetch ) ---> Fetching Data
    Call SqlCommit(hSqlParty) ----> Committing


    hSqlParty ------> Handle to Execute that command

  6. #6
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    The WHILE loop is never terminated.

    I am front end as Gupta sqlwindows
    This isn't an Access FE?
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •