SPONSORS:






User Tag List

Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Dec 2000
    Location
    India
    Posts
    44
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

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

    I am using MS EXCEL ODBC driver to access xls data files as database.

    One of the field is CaseID the value of which is empty in the XLS and got while inserting a record in my application under test.

    The value of CaseId is obtained from the AUT through silk Test and store in a string variable sCaseid. I need to update the CaseId in the table CREATECASEDATA.
    I am using the following statements in SILKTEST to achieve the same.

    hDB= DB_Connect("dsn=Wes_Dsn;ReadOnly=False")

    hSQL= DB_ExecuteSQL (hDB, "UPDATE CREATECASEDATA SET CaseId = sCaseid WHERE TITLE='Create case test one'")

    But the following error is displayed:
    *** Error: (07002) [Microsoft][ODBC Excel Driver] Too few parameters. Expected 1.
    Occurred in DB_ExecuteSql


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

  2. #2
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Error: (07002) [Microsoft][ODBC Excel Driver] Too few parameters. Expected 1.

    I assume you are actually writing 'sCaseid' with curly brackets around it in your sql query?

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

  3. #3
    Member
    Join Date
    Dec 2000
    Location
    India
    Posts
    44
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Error: (07002) [Microsoft][ODBC Excel Driver] Too few parameters. Expected 1.

    Thanks a lot. It works now with curly braces.
    Actually I was not using it.

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

  4. #4
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Error: (07002) [Microsoft][ODBC Excel Driver] Too few parameters. Expected 1.

    A good way of debugging such a problem is to have your script print (in the results) the sql query it is about to execute; a wrapper around DB_Execute() is useful for this purpose.
    Then if you need to do any debugging, as in this instance, you can copy the query out of the results file and use it in an odbc query tool. This will allow you to fiddle with the query until it works, a lot more quickly than rerunning your script multiple times.

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

  5. #5
    Member
    Join Date
    Dec 2000
    Location
    India
    Posts
    44
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Error: (07002) [Microsoft][ODBC Excel Driver] Too few parameters. Expected 1.

    Well that will help me a lot. I will make it a practice to print the sql query to results file henceforth.

    I will need to know what is odbc query tool. I am using Win NT with service pack 6. Will the odbc query tool part of the OS? Or do I need to download it from somewhere?


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

  6. #6
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Error: (07002) [Microsoft][ODBC Excel Driver] Too few parameters. Expected 1.

    There are loads of odbc clients out there; a fairly simple-to-use one is odbctest; it is downloadable from qadownloads.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 04:13 PM.

Copyright BetaSoft Inc.