SPONSORS:






User Tag List

Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Feb 2001
    Location
    Allendale, NJ, USA
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Updating an Excel Spreadsheet using the ODBC driver

    When I run this script in Silk 5.0.3.1, I get a 07002 error: "Too few parameters. Expected 1." I believe I have my ODBC drivers configered correctly, not to be read only. (Testcases with SELECT statements do work with the driver.)
    Any ideas would be helpfull. - Thanks


    void xlsSaveId ( in INTEGER iDataSetNo, in INTEGER Id )
    [ ] HANDLE hXLS
    [ ] HANDLE hSQL
    [ ] STRING sUpdateStr

    [ ] hXLS = DB_Connect("DSN={xlsData}")

    [ ] sUpdateStr = "UPDATE `Data$` `Data$` SET Id = {Id} WHERE DataSetNo = {iDataSetNo}"

    [ ] hSQL = DB_ExecuteSQL ( hXLS, sUpdateStr )
    [ ] DB_FinishSQL (hXLS )
    [ ] DB_Disconnect ( hXLS )

    [ ] return

    testcase TestxlsSaveId () appstate none
    [ ] xlsSaveId ( 1, 123 )

    *** Error: (07002) [Microsoft][ODBC Excel Driver] Too few parameters. Expected 1.
    Occurred in DB_ExecuteSql

    ------------------
    Bob Strong
    robert.strong@kodak.com


    [This message has been edited by RobertStrong (edited 02-14-2001).]

    [This message has been edited by RobertStrong (edited 02-14-2001).]
    Robert W. Strong
    robert.strong@kodak.com

  2. #2
    Senior Member
    Join Date
    Mar 2000
    Location
    Dublin, Ireland
    Posts
    152
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Updating an Excel Spreadsheet using the ODBC driver

    Hi Bob,

    Anytime that I have come across this error, it has to do with the SQL statement rather than the DB_ExecuteSQL. Have you tried to print out the SQL query and paste this directly into the DB_ExecuteSQL function call. If that works then the problem would appear to lie with the DB function.

    John.

    ------------------

    John O'Neill.
    Quality Automation Ltd.
    www.quality-automation.com
    John O'Neill.
    Quality Automation Ltd.
    www.quality-automation.com

  3. #3
    Junior Member
    Join Date
    Feb 2001
    Location
    Allendale, NJ, USA
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Updating an Excel Spreadsheet using the ODBC driver

    I tried John's suggestion like this:

    hSQL = DB_ExecuteSQL ( hXLS, "UPDATE `Data$` `Data$` SET Id = 123 WHERE DataSetNo = 1" )

    and got the same error.

    Robert W. Strong
    robert.strong@kodak.com

  4. #4
    Super Member
    Join Date
    Jul 1999
    Location
    Rancho Santa Margarita, CA
    Posts
    1,439
    Post Thanks / Like
    Mentioned
    4 Post(s)
    Tagged
    1 Thread(s)

    Re: Updating an Excel Spreadsheet using the ODBC driver

    A good way to diagnose this kind of problem is to use another tool capable of executing your SQL statements (like: SQLPlus, PL/SQL Developer, etc.). If, by using one of the other database tools, your SQL statements fail to execute, at least you eliminate questioning either your ODBC connection or the DB_ExecuteSql command.

  5. #5
    Guest

    Re: Updating an Excel Spreadsheet using the ODBC driver

    I don't know if this will help or not, but I always fully qualify the column in my update statements. You might try making your statement:


  6. #6
    Junior Member
    Join Date
    Feb 2001
    Location
    Allendale, NJ, USA
    Posts
    4
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Updating an Excel Spreadsheet using the ODBC driver



    Problem solved. I miss-typed a column name!



    Thanks every one for your help and suggestions. It was a learning experience reguardless.

    (The function, as posted above, is fine.)


    ------------------
    Bob Strong
    robert.strong@kodak.com
    Robert W. Strong
    robert.strong@kodak.com

 

 

Posting Permissions

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

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 07:21 PM.

Copyright BetaSoft Inc.