使用系统数据源而不是用户数据源作为ODBC连接字符串 [英] Using System Datasource instead of User Datasource as ODBC Connectionstring

查看:85
本文介绍了使用系统数据源而不是用户数据源作为ODBC连接字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

OdbcConnection DbConnection = null;
        try
        {
            DbConnection = new OdbcConnection(
                "Driver=SQL Anywhere 10;" +
                "Uid=user;" +
                "pwd=pass;" +
                "Dsn=<name>");
            DbConnection.Open();
        }
        catch (Exception e)
        {
            Console.WriteLine(e.Message);
            Console.ReadKey();
            System.Environment.Exit(0);
        }

现在我的问题是,如果<name>是用户数据源名称,则一切都很好. 另一方面,如果我将System-Datasourcename用作<name>,则会抛出一个错误,即找不到Datasourcename.有什么提示可以使用System DSN吗?

Now my problem is that if <name> is a User-Datasourcename everything is fine. On the other hand if i use a System-Datasourcename as <name> it throws me an error that it can't find the Datasourcename. Any hints how i could use a System DSN?

提前谢谢.

两个示例图片: http://i.stack.imgur.com/3h7vh.png http://imgur.com/5Govx

Two example Images: http://i.stack.imgur.com/3h7vh.png http://imgur.com/5Govx

推荐答案

X64 DSN 对于 X86 应用程序不可见...

X64 DSN is not visible for a X86 Application...

这篇关于使用系统数据源而不是用户数据源作为ODBC连接字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆