Create ODBC system DSN Dynamically ?

Hey Guru ,
Does any one know how to create a system DSN for CSV and
EXCEL dynamically using coldfusion or any other languauge VB ?, on
net there are loads of examples for access and MSSQL server but
none forCSV or EXCEL
Thanks a lot in advance ..

I just tried it again as a Startup Script in the GPO, it only is applied if I add the user to the local Admins Group.
A startup script is applied to a computer at reboot.  It is not applied to an OU with users.  Apply the GPO to the computer container.
Just use the GPO that defines DSNs.
¯\_(ツ)_/¯

Similar Messages

  • Remove odbc system dsn using batch file and odbcconf

    I create user system dsn entries by using a batch file and odbcconf call.  I've found references here on how to do that, yet cannot seem to find any results on how to remove them using that same call.  The library information (http://msdn.microsoft.com/en-us/library/ee388579(VS.85).aspx) states add and modify a system dsn for configdsn and configsysdsn and references equivalent to SQLConfgDataSource function. (http://msdn.microsoft.com/en-us/library/ms716476(VS.85).aspx) but the config data source function has a a removal and this doesn't seem too. 
    Apologies for being obtuse, but I can't seem to locate it.  Any links to how this is done from a batch file are much appreciated.
    Regards,
    NR.

    John C is basically correct, you can remove a System ODBC data source via the registry, but there is apparently no way via odbcconf.exe.  That is of course really stupid and poor programming!
    John, however, forgot another important registry entry.  That key deletion he mentioned will disable the odbc connection, but not remove it entirely.  If you just do that and then open the "ODBC Data Source Administrator", you will find the
    connection is still listed, but you can't remove it or modify it.  It becomes completely screwed up! There is a value to delete as well which dictates if the connection is listed.  Consider it the "header" to the data source.
    Also, in Windows 2003 and 2008 at least, the registry key John C listed is not quite the location to modify either.  This is where to find them in those OSs:
    HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\%DSN%
    or
    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\%DSN%
    The "header" I reffered to is a string value in inside a key (not the whole key!)
    HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources
    or
    HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\ODBC Data Sources
    The string value is the data source name.  This entry must be removed to remove the data source listing entirely.
    Here are some batch snipets for creating and then removing an odbc data source.  I'm leaving out some premiliary chunks, but you can figure it out from here. If you can't, you probably shouldn't be messing with this stuff in the first place!
    In these scripts, I create and remove a 32-bit data source in either a 32-bit or 64-bit version of windows.  The windows folder variable gets set to either "C:\Windows\System32" or "C:\Windows\SysWOW64" depending on the os.  In case you didn't
    know, on a 64-bit machine there is are also 2 differrent versions of the "ODBC Data Source Administrator" gui tool and the data source lists differ (32-bit vs 64-bit lists).  The 32-bit version on a 64 bit OS is found at "C:\Windows\SysWOW64\odbcad32.exe". 
    The one in the start menu will load the 64-bit version so you will never find your 32-bit connections there.
    Note - for simplicity I use the database name as the user name and and the data source name as well (in case there was any confusion). 
    Create the connection like so:
    echo Creating 32-Bit System ODBC Connection "%DatabaseName%"...
    "!WindowsFolder!\ODBCCONF.EXE" CONFIGSYSDSN "!ODBCDriver!" "DSN=%DatabaseName%;Server=localhost;Port=3306;Database=%DatabaseName%;UID=%DatabaseName%;PWD=%DatabasePassword%"
    And then remove it like this:
    echo Removing 32-Bit System ODBC Connection "%DatabaseName%"...
    if "%WindowsBits%"=="32" (
    If Exist "!TempRegFile!" Del "!TempRegFile!"
    echo Windows Registry Editor Version 5.00>>"!TempRegFile!"
    echo.>>"!TempRegFile!"
    echo [-HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\%DatabaseName%]>>"!TempRegFile!"
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI\ODBC Data Sources]>>"!TempRegFile!"
    echo "%DatabaseName%"=->>"!TempRegFile!"
    regedit /s "!TempRegFile!"
    ) else (
    If Exist "!TempRegFile!" Del "!TempRegFile!"
    echo Windows Registry Editor Version 5.00>>"!TempRegFile!"
    echo.>>"!TempRegFile!"
    echo [-HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\%DatabaseName%]>>"!TempRegFile!"
    echo [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\ODBC\ODBC.INI\ODBC Data Sources]>>"!TempRegFile!"
    echo "%DatabaseName%"=->>"!TempRegFile!"
    regedit /s "!TempRegFile!"
    If Exist "!TempRegFile!" Del "!TempRegFile!"

  • ODBC System DSN's are invisible in teh Data Sources even though they exist

    For a long time I had a problem with Windows XP Pro systems that had NI-DAQ installed.  These machines were ATE controllers which had Labview applications deployed with NI-DAQ cards.  I needed database connectivity through several system DSN's for Access, Pervasive, and SQL server.  The problem was that after I installed NI-DAQ all the system DSN's would disappear in the Data Sources control panel in windows.  Then if I tried to create them again it would say they were already there.  I could actually edit them by name, delete them and recreate them, but they would not appear in the WinXP Data Sources Manager.  They would exist, but would be invisible.  They actually worked fine from an application perspective, but would be a pain to edit or know if I had set one up or not.
    I finally solved it with the help of my network admin and I wanted to post the solution for someone else with the same problem:
    I solved the invisible ODBC problem. NI installs an ODBC DSN called Citadel 4. When this is installed it adds its entry via a registry setting. The problem is it changes the "Default" key in HKLM\Software\ODBC\ODBC.INI from "No Value Set" to blank. For some reason, when ODBC Manager reads the list in this key, the blank screws it up. Deleting the Default setting causes the Default setting to be recreated as No Value Set and all appears again.
    -Devin
    I got 99 problems but 8.6 ain't one.

    I've accidentally answered my own question. I did a Software Update including the combo update to take me to 10.5.8 (Jeez, that took AGES! do all Software Updates in Leopard take that long?) - then I launched Mail and suddenly everything was there - receiving messages, and the mailboxes full of my messages. Perhaps it was a bug in 10.5.6

  • XEClient Install: ODBC System DSN

    Hi,
    I just installed XEClient Software on a clean Windows XP SP2 German. When I try to create a new System DSN in the ODBC Administrator using "Oracle in XEClient" I get a popup error message stating that ODBC drivers cannot be loaded, error code 106.
    Did I miss something?
    TIA,
    Chris

    Yes that's the problem: XE client is based on Instant Client and for ODBC you need "real client", here is also one more ODBC instant client Microsoft ODBC error on same issue.
    Message was edited by:
    Faust

  • Oracle ODBC System DSN Not Accessible in CR 2008 Developer x64

    Operating System: Windows Vista Enterprise x64 SP-2
    Application: Crystal Reports 2008 Developer SP-1 v12.1.0.892
    Oracle InstantClient Basic x64 v11.1.0.7.0 with ODBC and SQLPlus components installed
    In the CR 2008 Database Expert, under Create New Connection > ODBC (RDO), the system DSN that I created to access an Oracle database does not appear. The Oracle InstantClient and its ODBC componenet are working normally: I can access the Oracle database in question using SQLPlus or with a Perl script that accesses this database using the Oracle ODBC driver.
    Everything works normally on another system using Windows Vista Enterprise x86 SP-2, the same version of Crystal Reports 2008, and the same version of the Oracle InstantClient for x86. In this scenario the system DSN does appear in the list in the Database Expert, and various reports are able to access the database.
    Is CR 2008 Developer running on Vista x64 a supported configuration? Notwithstanding this, are there any workarounds?
    Thanks.
    Jeffry A. Spain

    Hi,
    1. It's important to understand which kind of DSN you have on an x64 system. 
    2. We can create an ODBC connection (DSN) on the 32-bit side of the system or on the 64-bit side of the system.       
    3. 32-bit applications will only see ODBC connections created in the 32-bit side, and 64-bits applications will only see ODBC connections from the 64-bit side. Each kind of application has is own registry.  
    4. To setup DSN for 32-bit application you must use: %WINDIR%\SysWOW6\odbcad32.exe 
    5. To setup DSN for 64-bit application you must use: %WINDIR%\System32\odbcad32.exe  
    6. As BusinessObjects Eneterprise is a 32 bit application so we should create an ODBC DSN using the 'odbcad32.exe' from '%WINDIR%\SysWOW64\'.

  • How to use VBScript to access a 32bit ODBC System DSN (Excel) on a Windows 7 64bit system?

    What is the correct way to connect to a 32bit System DSN (Excel) on a Windows 7 64bit system?
    I've recently switched from Windows XP Pro x32 to Windows 7 x64.  Now, one of my scripts that uses an ODBC connection will no longer work.  After a bit of searching, I discovered that Windows 7 x64 does not currently have 64bit Excel drivers.  However, you can set up 32-bit connections by running "C:\Windows\SysWOW64\odbcad32.exe".  Unfortunately, my script still won't work even though I set up the System DSN exactly like I did on my old computer.  When I run my script, I get the following error:
    Quote:
    Script:  X\XML_Check.vbs
    Line:  212
    Char:  3
    Error:  [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application.
    Code:  80004005
    Source:  Microsoft OLE DB Provider for ODBC Drivers
    Line 212 contains:
    objConnection.Open "DSN=charge_codes_XLS;"
    It seemed to me that wscript.exe will only communicate properly with an identical environment (x32 to x32 or x64 to x64, but not x64 to x32 or x32 to x64).  With that in mind, I found a way around the error by running my script via the 32bit version of Windows Script Host.  I changed the shortcut path from "X:\XML_CHECK.vbs" to "C:\Windows\SysWOW64\wscript.exe X:\XML_CHECK.vbs" and the script appears to function ok. 
    What I really want to know is if there is a way to run my script via the 64bit version of wscript.exe yet have it connect to the 32bit ODBC subsystem? Is there a specific connection string I can use or am I just out of luck until Microsoft puts out 64bit Excel drivers?

    I faced the same issue recently. There was a 32bit MSOffice installed on the 64bit server and the same visual basic code worked from MS Office script debugger, and did not in the cscript/wscript.
    It seems that 
      - the  cscript/wscript used 64bit ODBC driver
      - the  office used     32bit ODBC driver
    Excel drivers are installed for 32bit ODBC (because of 32 bit office the ODBC manager 32bit was a full hand of drivers).
    Excel drivers are NOT installed for 64bit ODBC manager (because of 32 bit OFFICE) and can not be installed while the 32bit MS OFFICE is installed.
    The SQL drivers are installed for 64bit ODBC (so that is why the SQL connection was established well)
    The solution would be to run .js .vbs scripts in 32 bit environment:
    \windows\SysWOW64\cscript.exe or \windows\SysWOW64\wscript.exe 
    Search for more with: how do i run a vbscript in 32 bit mode on a 64 bit machine

  • Problem in creating ODBC new DSN in Informatica

    I Installed
    1. Oracle 11g R2 64 bit
    2. Informatica 9.1.0 64 bit
    Successfully. but when I tried import tables from Oracle, I got an error in creating ODBC DSN [ERROR NO:193].
    But when I create through ODBC Aministration Tool through control panel, the DSN is sucessfully created. But this can not be used in informatica [It is giving the error 193].
    Finally I found that this informatica 9.1 [64 bit] is using 32 bit odbc driver.[By calling c:\\syswow64\odbcad32.exe].
    How can we make informatica to use the ODBC 64bit Administration tool [c:\\system32\odbcad32.exe].
    Please help me to correct the settings.
    Thank you in advance
    Edited by: 978351 on Dec 23, 2012 10:42 PM

    Did you get any answer on this? Even i see same issue... I have Win 7 64 bit OS and 64 bit Oracle and 64 bit Informatica. Not able to create ODBC connections because informatica is pointing to 32 bit ODBC.
    regards,
    Srikanth

  • Setting up ODBC System DSN

    I have successfully installed the Oracle 8.1.7.3.0 ODBC driver (through the Universal Installer) on a Win 2000 Pentium 4 pc. When I attempt to add a new System DSN using the installed Oracle ODBC driver, as soon as I select "Oracle in DEFAULT_HOME", I get the following error message... "The setup routines for the Oracle in DEFAULT_HOME ODBC driver could not be loaded due to system error code 126."...any ideas???? I am using Microsofts standard Microsoft ODBC for Oracle to access a few 8.0.5.2.0 databases, but when I try using that same driver to access the 8.1.7.3.0 database, I can only access 1 table from any schema. Help!!! I read elsewhere in this forum that the driver installed must match the Oracle client software version. If this is true, how do I determine what version my client software is (my SQL*Plus version is 8.0.5.2.0). Any recommendations?
    Thanks!
    Torrey

    It sounds like you have an 8.0.5 Oracle client. Try using the 8.0.5.x ODBC driver.
    Justin

  • Seeking for VB code to run the report conect to ODBC system DSN

    I use the VBcode to run the CR report from VB application.
    Works great when the report connect to mdb through DAO engine..
    Set CrxReport = apps.OpenReport(App.Path & "/" & Reportfile & ".rpt")
    CrxReport.Database.Tables(1).ConnectionProperties.Item("Database Password") = "syspass"
    Now I make my report connect Access 2007 through System DSN in ODBC.
    Set CrxReport = apps.OpenReport(App.Path & "/" & Reportfile & ".rpt")  -- works.
    CrxReport.Database.Tables(1).ConnectionProperties.Item("Database Password") = "syspass"
    -- Get Crystal error-214726270.
      Any help?
    Many Thanks!
    Daphne

    Moved to Legacy SDK forum.
    Need more info. What version of CR and which report engine are you using?
    Thank you
    Don

  • Installed MySQL ODBC, system DSN configured and working, provider still not showing in SQL 2005 provider list

    As per the title, really.
    I need to fetch data periodically from a MySQL DB. Installed the 5.1 MySQL 32bit ODBC driver onto the SQL server, configured and tested the DSN, all fine.
    Provider still not showing in the list in Management Studio.
    Can anyone offer any advice? is it a simple case of restarting services? I haven't tried that due to the server being in production.

    Hello,
    Is this a 64 bit SQL Server? For a linked server you can only use OleDB data provider, have you also installed OleDB for MySQL? If not, then you have to use the ODBC OleDB provider together with a System DSN.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Modify ODBC System DSNs with scripts

    Hi All;
    I work in Windows 7 and have set System DSNs for our SQL servers. We have several of them each corresponding to a different environment ( dev vs uat vs production ) and I have to constantly switch from one environment to another for debugging and/or testing.
    I was wondering if there was a way to modify the settings (only need to change the SQL Server name) via a command line, script or powershell without having to open the ODBC control panel all the time?
    kaedee

    Here is what I did;
    * opened regedit
    * found the key i needed to change
    * exported the key as a .reg file
    * made the changes I needed to the .reg file
    now I am able to apply the changes to the database name simply by opening/executing the .reg files
    thanks

  • Cannot See ODBC System DSN's on Windows Vista 64bit in Crystal Reports 2008

    Hi,
    I have installed Crystal Reports 2008 on my Windows Vista 64 bit PC and have setup an ODBC connection to my mySQL box which I wish to report on.
    Crystal Reports however does not see the ODBC DSN's which I have configured.
    I have installed the product on a 32 bit Windows system with no problems.
    Is there a solution to this?
    Thanks.

    I have found the solutions;
    My ODBC drivers did in fact install. Microsoft, in all their wisdom, has 2 versions of odbcad32. A 32 bit and a 64 bit. They are both named odbcad32.exe.
    They put the 32 bit odbcad32.exe in the syswow64 directory. They put the 64 bit odbcad32.exe in the system32 directory. 32 bit apps will pick up the 32 bit registry setting and 64 bit will pick up the 64 bit registry setting. system32 comes before syswow64 in the system path so the 64bit software runs before the 32 bit software.
    So, when I manually ran odbcad32.exe in the syswow64 directory, I was able to configure my connections and everything worked fine.

  • Cannot access remote FoxPro dbf file using jdbc-odbc and system DSN

    Hi all,
    I have a foxpro database sitting on remote server (netware server). the dbf folder is shared and I can access it using windows explore on my weblogic server (windows 2003). I created a system dsn for that. I can access the database from the a stand alone java program using
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection surgConn = DriverManager.getConnection("jdbc:odbc:FoxDB", " ", " ");
    But when I use the same thing in my weblogic 8.1 application, I cannot access the database. I didn't config any data source in weblogic 8.1
    Why?
    When I try this on my own computer - windows 2000, weblogic 8.1 workshop. remote foxpro database dbf folder. it works.
    Any idea?
    Thanks very much

    Laura Ren wrote:
    Hi all,
    I have a foxpro database sitting on remote server (netware server). the dbf folder is shared and I can access it using windows explore on my weblogic server (windows 2003). I created a system dsn for that. I can access the database from the a stand alone java program using
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection surgConn = DriverManager.getConnection("jdbc:odbc:FoxDB", " ", " ");
    But when I use the same thing in my weblogic 8.1 application, I cannot access the database.What exception do you get? WebLogic is just like any other Java App. That code
    should work OK (though I have a better way)... Be warned that the JDBC ODBC
    bridge is specifically dangerous. It is not threadsafe.
    Joe
    I didn't config any data source in weblogic 8.1
    Why?
    When I try this on my own computer - windows 2000, weblogic 8.1 workshop. remote foxpro database dbf folder. it works.
    Any idea?
    Thanks very much

  • ODBC Administrator (32-bit ..\SysWOW64\odbc32ad.exe) fails on System DSN add, with error code 126

    Logging into W2008R2 server with ID which is a member of "Administrators" group.  Installed 32-bit PostgreSQL driver via msi package.  When using 32-bit ODBC Administrator to create "System DSN", receive error as follows:
    "The setup routines for the PostgreSQL ANSI ODBC driver could not be loaded due to system error code 126: The specified module could not be found. (C:\psqlODBC\0903\bin\psqlodbc30a.dll).
    I have verified the file does exist, by that name, in that location and the registry entries look good (I am not allowed to insert images until my account is "verified").
    The ODBC Administrator lists the 32-bit driver (along with all the others) in the Drivers tab.  I am successful creating a System DSN if I choose a different 32-bit driver (e.g. the IBM DB2 driver).  Thank you for any direction you can provide.

    Hi JMARKS6205-2,
    Sorry for my delay.
    Based on your description, it seems that you have checked the registry entries. On current situation, I suggest
    that you should check again. Just to confirm.
    Please open Registry Editor and navigate to the path: HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI
    Since installation information for ODBC drivers is stored in this key. Please make sure that the required ODBC
    driver file (psqlodbc30a.dll) is in the correct folder as described by the registry keys.
    For more details, please refer to the following KB.
    PRB: Error Message: "Could Not Load Translator or Setup
    Library"
    If any update, please feel free to let me know.
    Hope this helps.
    Best regards,
    Justin Gu

  • JDBC ODBC System vs User DSN

    Hi... I've got an Acees db setup as a User DSN source. When I acees this source off of this machine with a java executable ( one with a main method), no problems. When I put the exact same connection code into a JSP page, I get the following error...
    SQLException : [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
    Is this error because I'm accessing the JSP through a server which resides on another machine and so doesn't see the User DSN source? If so, how do I create a System DSN? I'm on a university intranet here and they don't allow us to do anything (or maybe I'm just bad :D) On the university's intranet page it does say the following...
    "DATABASE support (System DSN called 0014157, access 2000 database in database folder)"
    But eh, like, er, how do I write the connection line then? Do I just stick my database into the database folder and er, like, then, er, what... ?
    All and any help appreciated... merry christmas.
    import java.sql.*;
    public class Test {
         public static void main (final String [] args) {
              try {
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   Connection con = DriverManager.getConnection ("jdbc:odbc:217cw");
                   Statement stmt = con.createStatement();
                   ResultSet res = stmt.executeQuery ("SELECT ImageUrl FROM Weapons");
                   while (res.next ()) {
                        System.out.println (res.getString ("ImageUrl"));
              catch (final SQLException sqe) {
                   System.out.println (sqe.getMessage ());
              catch (final ClassNotFoundException cnfe) {
                   System.out.println (cnfe.getMessage ());
    }

    Commonly system DSNs are recommended rather than user DSNs.
    How to make them:
    my control panel for ODBC has a tab folder "user DSN" and another one "system DSN". Each shows a list of existing DSNs of that type and offers a button to create a new one of that type.

Maybe you are looking for

  • Updates through a maintenance view

    Hi, I'm having difficulty with maintenance views. I thought it ws possible to construct a maintenance view consisting of two or more tables and be able to update non-key fields in any table, provided the tables were linked via FK and had suitable car

  • New iPad2, can no longer connect to Wi-Fi

    Just got and iPad2, could connect up to Wi-Fi and the Internet (set up bookmarks, etc.), but can no longer get on the Internet.  Reset network settings, forgot network, entered data again, turned off Wi-Fi, turned it back on.  Still shows iPad 2 is c

  • Can no longer send SMS' to my email, sends as imessage to my phone instead

      I have an iphone 5 and before 6.0 I was able to send texts to my email, but now it seems more linked to my apple account.  When I try to send a sms to my email it sends it as an imessage instead, which my phone recieves as a imessage.  I tried goin

  • Change Apple ID on old apps purchased with different Apple ID

    Had to change Apple ID to iCloud address now cannot update old apps on iPhone 5 because of the old Apple ID how do I change the Apple ID on the old apps to allow me to update? I beget new apps

  • Value set - hierarchy

    Hi, I have an issue where I want to add a descriptive flexfield. The flexfield should be added in an existing hierarchy that consists of 3 fields: 1. Category 2. Type 3. Priority All the flexfields have value sets connected to them. Type is dependent