[Microsoft] [ODBC驱动程序管理器]未找到数据源名称且未指定默认驱动程序 [英] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

查看:263
本文介绍了[Microsoft] [ODBC驱动程序管理器]未找到数据源名称且未指定默认驱动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的编码是: -





My coding is:-


public class Withoutdsn {

    public static void main(String[] args) 
    {
        try
        {
        String database="dsn.accdb";//Here database exists in the current directory

        String url="jdbc:odbc:Driver={Microsoft Access Driver(*.mdb,*.accdb)};DBQ=" + database + 

";DriverID=22;READONLY=false";

        Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        Connection c=DriverManager.getConnection(url,"","");
        Statement st=c.createStatement();
        ResultSet rs=st.executeQuery("insert into login values('Anoop','Delhi')");
  
  
        }
        catch(Exception e)
        {
            System.out.println(e);
        }
    }
}







获取错误 [Microsoft] [ODBC驱动程序管理器]未找到数据源名称且未指定默认驱动程序。我有32位操作系统。我无法找到我的错误。请帮帮我。我正在创建一个项目,我想在其中为MS Access创建一个无DSN连接(.accdb)。

如果您有任何代码连接.accdb文件请分享。

Thanx提前




Getting Error [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified. I have 32 bit OS. I am unable to find my error.Please help me. I am creating a project in which I want to Create a DSN-less connection for MS Access(.accdb).
If you have any code connecting .accdb file please Share.
Thanx in advance

推荐答案

这是另一个有用的链接 访问MS-Access数据库来自Java [ ^ ]
Here is another helpful link Access MS-Access Databases from Java[^]


Access 2007的连接字符串 [ ^ ]有许多可能对您有所帮助的示例。
Connection strings for Access 2007[^] has a number of examples that might help you.


这篇关于[Microsoft] [ODBC驱动程序管理器]未找到数据源名称且未指定默认驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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