SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 5 of 5
  1. #1
    Senior Member
    Join Date
    Nov 1999
    Location
    Eagle, ID,USA
    Posts
    1,035
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    DSN less Excel Connection using Jet OLE DB

    Anyone know the syntax for connecting to an excel spreadsheet using the Microsoft Jet OLE DB Provider? Using the following syntax:

    hdbc = DB_Connect ('Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\ExcelFtn.xls;Extended Properties=""Excel 8.0;HDR=No;"";');

    gives the following error:

    *** Error: (IM002) [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

    Using the following ODBC DSN-Less method works ok:

    hdbc = DB_Connect ("DRIVER=Microsoft Excel Driver (*.xls);FIRSTROWHASNAMES=0;READONLY=FALSE;DRIVERID =790;DBQ=c:\ExcelFtn.xls");

    But due to the MDAC bug where setting FIRSTROWHASNAMES has no effect, I wanted to try Microsofts recommended workaround.
    Have you ever noticed? Anybody going slower than you is an idiot, and anyone going faster than you is a maniac.

  2. #2
    Senior Member
    Join Date
    Jan 2003
    Location
    Portland, ME USA
    Posts
    603
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: DSN less Excel Connection using Jet OLE DB

    Tony,

    Were able to connect to Excel without having a dsn connection set up? If so could you explain how you accomplished this?

    Thanks in advance.
    N+ CNA

  3. #3
    Senior Member
    Join Date
    Nov 1999
    Location
    Eagle, ID,USA
    Posts
    1,035
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: DSN less Excel Connection using Jet OLE DB

    using the following string as described in my original post:

    hdbc = DB_Connect ("DRIVER=Microsoft Excel Driver (*.xls);FIRSTROWHASNAMES=0;READONLY=FALSE;DRIVERID =790;DBQ=c:\ExcelFtn.xls");

    I was not able to connect using the Jet OLE DB Provider method.
    Have you ever noticed? Anybody going slower than you is an idiot, and anyone going faster than you is a maniac.

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

    Re: DSN less Excel Connection using Jet OLE DB

    Tony: Silktest isn't capable of making an ole-db connection, so you will have to use odbc.

  5. #5
    Senior Member
    Join Date
    Nov 1999
    Location
    Eagle, ID,USA
    Posts
    1,035
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: DSN less Excel Connection using Jet OLE DB

    Ok, thanks Vince. Guess I'll just have to wait till MS decides to fix their bug.
    Have you ever noticed? Anybody going slower than you is an idiot, and anyone going faster than you is a maniac.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin 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 02:42 AM.

Copyright BetaSoft Inc.