SPONSORS:






User Tag List

Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Senior Member
    Join Date
    Mar 2001
    Posts
    161
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Getting data from Excel

    User (sree7405@yahoo.com) posted:

    hi,
    I trying to execute the following statement.
    string sName
    String sSQL = "SELECT `Sheet2$`.Fname INTO '{sName}' FROM `Sheet2
    $``Sheet2$`"
    [ ] Handle hSQL = DB_ExecuteSql(hDB,sSQL)
    [ ] Print(sName)
    But i am getting the following error.

    *** Error: Variable has not been set.
    what is wrong in the SQL statement.
    Sri

    Post message: silktest@yahoogroups.com
    Subscribe: silktest-subscribe@yahoogroups.com
    Unsubscribe: silktest-unsubscribe@yahoogroups.com
    List owner: silktest-owner@yahoogroups.com
    URL to this page: http://groups.yahoo.com/group/silktest


    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/



  2. #2
    Senior Member
    Join Date
    Jul 1999
    Location
    Boston, MA. USA
    Posts
    163
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting data from Excel

    Hello Silk Test,

    I may be able to help. There was an article in the March '99 issue of segue@work that dealt with accessing info in Excel using DBTester. I am going to link in the URL here: http://customers.segue.com/protected...messo_toc_.htm

    NOTE: You will need a valid username and password to access the newsletter. (I also tried to link in the Word doc to this reply, but the file size is too large. If you cannot access the newsletter, please email me offline and I will email the article to you.)

    Disclaimers: I am not technical. I may not be properly understanding your question. Also, the article is two years old. SilkTest/DBTester may have changed in significant ways since James Soderborg wrote the article. (However, I do think the information is still valid.)

    Hope this helps!
    Heidi Gilmore
    Segue
    hjgilmore@mediaone.net

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

  3. #3
    Senior Member
    Join Date
    Mar 2001
    Posts
    161
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting data from Excel

    User Bob Pekarek (bpekarek@mwt.net) posted:

    How about a DB_FetchNext to populate variable sName?


  4. #4
    Senior Member
    Join Date
    Jan 2001
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting data from Excel

    Heidi Gilmore:

    I just read this article(very neat). Everything worked like a breeze.

    SilkTest:

    I want to know how to populate an excel file. The dbresult.t(included in silk with extentive examples) gives me error.

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

  5. #5
    Senior Member
    Join Date
    Sep 2000
    Location
    Twin Cities, MN, USA
    Posts
    653
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting data from Excel

    Is Fname a variable? Named range?

    [This message has been edited by SteveC (edited 05-24-2001).]

  6. #6
    Senior Member
    Join Date
    Jan 2001
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting data from Excel

    Fname is the column name. I think sName=Null and never set so the print() statement went bad. Also your SQL either returns nothing or something wrong cuz sName is NULL.

    NOW your logic based on the above code

    Make your own conclusions


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


    [This message has been edited by GodKnows (edited 05-25-2001).]

  7. #7
    Senior Member
    Join Date
    Jul 1999
    Location
    Boston, MA. USA
    Posts
    163
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting data from Excel

    Well, as you all have certainly realized by now, I am not that technical. So, when I really can help all you technical gurus, it feels good! Thanks, GodKnows, for letting me know the article was relevant.

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

  8. #8
    Senior Member
    Join Date
    Sep 2000
    Location
    Twin Cities, MN, USA
    Posts
    653
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting data from Excel

    This might be a useful thing to figure out, but after spending a couple hours working on a resolution to this (my own time, boss ) I haven't been able to come up with anything. I can get this to work:
    But if I add this to see what I got:
    All I get is a list of Nulls.

    Switching over to an Access database, I found that this works:
    At this point I'm as frustrated as you probably are! If you have access to Access (?) I would go that route.

    [This message has been edited by SteveC (edited 05-26-2001).]

  9. #9
    Senior Member
    Join Date
    Jan 2001
    Posts
    750
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting data from Excel

    Dumb question from me:

    Why do you end your SQL in semi-colon( ?

    Did you try it without it? I have no access installed so I can't test it.

    Also do an DB_FinishSql(hSQL) before you do a second DB_ExecuteSql(), just in case.

    That's all I can think of assuming everything else are correct, cheers.

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

  10. #10
    Senior Member
    Join Date
    Sep 2000
    Location
    Twin Cities, MN, USA
    Posts
    653
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Getting data from Excel

    Using a semicolon is a holdover from doing too much Oracle work. I code the queries manually so it's always there. But it works so I just leave it.

    I don't use a DB_FinishSQL after the first DB_ExecuteSQL because I need to keep using FetchNext from that first query to populate the variables into the DB. By using another handle (hSQL2) I'm able to loop using both queries.

    For this simple example I excluded both the DB_FinishSQL and DB_Disconnect, which would be proper form. But I read somewhere (maybe here) that the handles and connection are cleaned up when the testcase exits anyway.

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

 

 
Page 1 of 2 12 LastLast

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:14 PM.

Copyright BetaSoft Inc.