SPONSORS:






User Tag List

Page 1 of 4 1234 LastLast
Results 1 to 10 of 34
  1. #1
    Guest

    Writing data to excel spreadsheet ?

    Is anybody knows how to write data through 4Test script into Excel spread sheet ?

    I have script, which reads data from excel spread sheet, (i.e. reading all names of column and all numbers of second column), BUT, Now after using this data, I would like to write it back to spread sheet. I think 4Test have the capability to write data (i.e. about 10-15 names in third coloumn)

    Can 4Test write data to Excel spread sheet ?

    Any responce will be appreciated.



    ------------------
    California.
    Silk1997@hotmail.com

  2. #2
    Senior Member
    Join Date
    Jul 2001
    Location
    Elizabeth, CO, USA
    Posts
    653
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Writing data to excel spreadsheet ?

    There's a white paper about working with Excel that can be found <a href=http://www.ameliortech.com/stuff/toolkits/ST/st_whpap.htm>here</a>.

    - Dave

    ------------------
    Amelior Technology
    dreed@ameliortech.com
    WaltzingRhino.com
    A concerned Borland customer, a fly in the ointment, a wrench in the works.

  3. #3
    Guest

    Re: Writing data to excel spreadsheet ?

    I used your given web site, last month, But It only shows how to read from excel spread sheet, NOT HOW TO WRITE INTO EXCEL SPREAD SHEET......,

    Shafi.

    ------------------
    California.
    Silk1997@hotmail.com

  4. #4
    Senior Member
    Join Date
    Jul 2001
    Location
    Elizabeth, CO, USA
    Posts
    653
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Writing data to excel spreadsheet ?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by Silk1997:
    I used your given web site, last month, But It only shows how to read from excel spread sheet, NOT HOW TO WRITE INTO EXCEL SPREAD SHEET......,

    <HR></BLOCKQUOTE>

    Well, to write into the "table" in the spreadsheet you'd use an INSERT SQL statement.

    - Dave


    ------------------
    Amelior Technology
    dreed@ameliortech.com
    WaltzingRhino.com
    A concerned Borland customer, a fly in the ointment, a wrench in the works.

  5. #5
    Guest

    Re: Writing data to excel spreadsheet ?

    It doesn't work, May be my sql statement is wrong, here is code....

    [-] testcase GetInsertData () appstate none
    [ ]
    [ ] HANDLE hDB
    [ ] HANDLE hSQL
    [ ] INTEGER iAge
    [ ] STRING sName
    [ ]
    [ ] //connect to the database
    [ ] hDB = DB_Connect ("dsn=SilkTest_db")
    [ ]
    [ ] //Insert name=AAA into tablename 'Ages'
    [ ] hSQL = DB_ExecuteSQL (hDB, "Insert into Ages Name Value AAA")
    [ ]
    [ ] //execute a SQL statement
    [ ] hSQL = DB_ExecuteSQL (hDB, "SELECT Name, Age from Ages")
    [ ]
    [ ] //while there are still rows to retrive
    [ ]
    [-] while DB_FetchNext (hSQL, sName, iAge)
    [-] if (sName == NULL)
    [ ] break
    [ ] print ("Name:{sName}; Age:{iAge}")
    [ ]
    [ ]
    [ ]
    [ ]
    [ ]
    [ ] DB_FinishSql (hSQL)
    [ ]
    [ ] //disconnect from thedatabase
    [ ] DB_Disconnect (hDB)


    ------------------
    California.
    Silk1997@hotmail.com

  6. #6
    Member
    Join Date
    May 2001
    Location
    New York, NY, USA
    Posts
    64
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Writing data to excel spreadsheet ?

    Try modifying the SQL to :

    "Insert into `Ages$` Name Value 'AAA'"
    "SELECT Name, Age from `Ages$`"

    Note that the symbols around Ages are not regulat single quotes.

    -Zareh

    ------------------
    Amelior Technology
    zarehk@ameliortech.com

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

    Re: Writing data to excel spreadsheet ?

    SQL is a standard language to access different DBs(Oracle, DB2, Sybase, Informix, Microsoft SQL Server, Access, and others). Also each company have their own extentions to it for their own benefit.

    Here is the link where you can learn how to use it. (http://www.w3schools.com/sql/default.asp)

    this page about the insert-statement:
    http://www.w3schools.com/sql/sql_insert.asp

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

  8. #8
    Guest

    Re: Writing data to excel spreadsheet ?

    It doesn't work, I tried everything...(Commented lines are what I tried one after another)

    [-] testcase GetInsertData () appstate none
    [ ]
    [ ] HANDLE hDB
    [ ] HANDLE hSQL
    [ ] INTEGER iAge
    [ ] STRING sName
    [ ]
    [ ] //connect to the database
    [ ] hDB = DB_Connect ("dsn=SilkTest_db")
    [ ]
    [ ] //Insert name=AAA into table name 'Ages'

    [ ] //hSQL = DB_ExecuteSQL (hDB, "Insert into 'Ages$' (Name, Age) Values('AAA', '22')")

    [ ] //hSQL = DB_ExecuteSQL (hDB, "Insert into Ages (Name, Age) Values ('AAA', '22')")
    [ ] hSQL = DB_ExecuteSQL (hDB, "INSERT into Ages Values ('AAA', '22')")

    [ ]
    [ ]
    [ ]
    [ ]
    [ ]
    [ ] //execute a SQL statement
    [ ] hSQL = DB_ExecuteSQL (hDB, "SELECT Name, Age from Ages")
    [ ]
    [ ]
    [ ] //while there are still rows to retrive
    [ ]
    [-] while DB_FetchNext (hSQL, sName, iAge)
    [-] if (sName == NULL)
    [ ] break
    [ ] print ("Name:{sName}; Age:{iAge}")
    [ ]
    [ ]
    [ ]
    [ ]
    [ ]
    [ ] DB_FinishSql (hSQL)
    [ ]
    [ ] //disconnect from thedatabase
    [ ] DB_Disconnect (hDB)


    ------------------
    California.
    Silk1997@hotmail.com

  9. #9
    Senior Member
    Join Date
    Jun 2000
    Location
    Chicago, IL USA
    Posts
    383
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Writing data to excel spreadsheet ?

    I think that you forgot to "name" a region in your Excel Workbook.
    Read Dave Reed's excellent whitepaper AGAIN.

    ------------------
    Rob Kapteyn
    Rob Kapteyn, CSTE
    RobKapteyn@gmail.com

  10. #10
    Guest

    Re: Writing data to excel spreadsheet ?

    No, I named region in excel spread sheet. It's reading from excel properly, but writing into excel.

    Shafi.

    ------------------
    California.
    Silk1997@hotmail.com

 

 
Page 1 of 4 1234 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 12:19 AM.

Copyright BetaSoft Inc.