Lazarus中文社区

 找回密码
 立即注册(注册审核可向QQ群索取)

QQ登录

只需一步,快速开始

Lazarus IDE and 组件 下载地址版权申明
查看: 2900|回复: 4

Win8.1下的TODBCConnection连接ACCESS

[复制链接]

该用户从未签到

发表于 2018-5-23 13:49:48 | 显示全部楼层 |阅读模式
看了论坛的帖子,一直连不上。偶然想起是不是驱动不对。果然,安装以下驱动就OK了。

Microsoft Access Database Engine 2010 Redistributable下载地址https://www.microsoft.com/en-us/download/details.aspx?id=13255

以下是我的连接代码:
     Conn.Driver := 'Microsoft Access Driver (*.mdb, *.accdb)';
     Conn.Params.Clear;
     Conn.Params.Add('DBQ='+GetCurrentDir() + '\att2000.mdb');
     Conn.Open;
     if Conn.Connected then
        //ShowMessage( 'odbc Conn Access is ok')
     else
        //showmessage( 'odbc Conn Access is error');
     Conn.KeepConnection := True;

     // //transaction
     SQLTrans.DataBase := Conn;
     SQLTrans.Action := caCommit;
     SQLTrans.Active := True;      



//***********************************************************************************
有个问题请教一下各位前辈
DBGrid控件的中文乱码,有没有简单的方法解决。

     //Conn.Params.Add('codepage = 65001');
     //Conn.Params.Add('CHARSET=ansi');      

这样的?
3ks !

回复

使用道具 举报

*滑块验证:

本版积分规则

QQ|手机版|小黑屋|Lazarus中国|Lazarus中文社区 ( 鄂ICP备16006501号-1 )

GMT+8, 2025-5-2 21:18 , Processed in 0.028519 second(s), 13 queries , Redis On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表