SPONSORS:






User Tag List

Results 1 to 10 of 10
  1. #1
    Junior Member
    Join Date
    Aug 2001
    Location
    HOOKSETT, NH US
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Retrieving Column names from an Access table



    How can I retrieve Column names(headers) from an Access Table?

    Energy


  2. #2
    Member
    Join Date
    Mar 2000
    Posts
    75
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Retrieving Column names from an Access table

    Try looking at the DB_Columns function in the 4Test reference. I believe you can get column names this way... it also has an example I am sure.

    Peter

  3. #3
    Senior Member
    Join Date
    Nov 2000
    Location
    Bloomington, IL
    Posts
    142
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Retrieving Column names from an Access table

    If you get this function to work please let us know. I have tried several times and could not get it to work.

    MikeF

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

  4. #4
    Member
    Join Date
    Mar 2000
    Posts
    75
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Retrieving Column names from an Access table

    Mike,

    I don't have a version of Silk that I can test on.... the example in the reference didn't help? What is the error you receive? (if any)

    Peter

  5. #5
    Member
    Join Date
    Aug 2000
    Posts
    58
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Retrieving Column names from an Access table

    Hi,
    Here is the code. I got it from Segue's technical support.

    It works. You have to modify it for your database.

    <pre>
    [-] testcase test ()
    [ ] HDATABASE hdbc
    [ ] HSQL hstmnt
    [ ] hdbc = DB_Connect ("DSN=AlarmLoggerDSN;UID=sa")
    [ ] STRING colname, sColName, ignore
    [ ] hstmnt = DB_Columns (hdbc, NULL, NULL, "AlarmDetail", "%")
    [-] while (DB_FetchNext (hstmnt, ignore, ignore, ignore, sColName) == TRUE)
    [ ] print (sColName)
    [ ]
    [ ]
    </pre>

    Yamini
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by energy075:


    How can I retrieve Column names(headers) from an Access Table?

    Energy

    <HR></BLOCKQUOTE>



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

  6. #6
    Senior Member
    Join Date
    Nov 2000
    Location
    Bloomington, IL
    Posts
    142
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Retrieving Column names from an Access table

    I am not sure what I was doing wrong, but your script worked great!!

    Thanks,
    MikeF

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

  7. #7
    Senior Member
    Join Date
    Jun 2000
    Location
    Sunyyvale CA USA
    Posts
    422
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Retrieving Column names from an Access table

    Hi,

    Did anybody tries using DB_ExecuteSQL to insert lot of reocords in a DB? How efficient is this?

    ------------------
    Sree
    Sree

  8. #8
    Member
    Join Date
    May 2001
    Posts
    56
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Retrieving Column names from an Access table

    I am using DB_ExecuteSQL function to insert records in an Access DB.(inserting more than 1000 records).So far it's working fine.

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

  9. #9
    Member
    Join Date
    Mar 2000
    Posts
    75
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Retrieving Column names from an Access table

    It depends what you feel is "alot" of records... It also depends on the database type that you are using and where the data is coming from?

    But usually DB_ExecuteSQL will work. But depending on the above criteria you will possibly see performance degredation.

    Peter

  10. #10
    Junior Member
    Join Date
    Aug 2001
    Location
    HOOKSETT, NH US
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Retrieving Column names from an Access table

    Thanks folks,

    Heres the code, that worked for me:

    [-] testcase AccessConn ()
    [ ] HDATABASE hdbc
    [ ] HSQL hstmnt
    [ ] hdbc = DB_Connect ("DSN=AnAccessFile;UID=sa")
    [ ] STRING sColName, sDataType, sIgnore,
    [ ] hstmnt = DB_Columns (hdbc, null, null, "MyTable", "%")
    [-] while (DB_FetchNext (hstmnt, ignore, ignore, ignore, sColName, sDataType) == TRUE)
    [ ] print ("Column: {sColName}, DataType: {sDataype}")

    Thanks yamini!

    Energy075

 

 

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:25 AM.

Copyright BetaSoft Inc.