ehxz 发表于 2023-5-11 15:38:13

pb不配置ODBC数据源、使用ODBC方式连接数据库

【路人】虾仁不眨眼(1540259151)15:24:36

//不配置ODBC数据源、使用ODBC方式连接数据库
//Access
SQLCA.DBMS = "ODBC"
SQLCA.AutoCommit=FALSE
SQLCA.DBParm = "ConnectString='driver=Microsoft Access Driver (*.mdb);DBQ=mdb文件路径'"

//SQL Server
SQLCA.DBMS = "ODBC"
SQLCA.AutoCommit=FALSE
SQLCA.DBParm = "ConnectString= '" +&
    "DRIVER=SQL Server; " +&
    "Database=数据库名称; " +&
    "UID=账号; " +&
    "PWD=密码; " +&
    "Server=地址; "
我电脑只有Access、SQL Server可以测试, mysql 没有安装

【路人】sogood(395902092)15:34:41
//ORACLE
SQLCA.DBMS = "ODBC"
SQLCA.AutoCommit=FALSE
SQLCA.DBParm = "ConnectString= '" +&
    "DRIVER=ORACLE; " +&
    "UID=用户名; " +&
    "PWD=用户密码; " +&
    "Server=连接名; "

大家CV起来

ehxz 发表于 2023-5-11 15:56:42

【路人】lzf(110213436)15:55:41
SQLCA_local.DBMS = "ODBC"
SQLCA_local.DBParm = "ConnectString='DRIVER=SQLite3 ODBC Driver;NoCreat=1;Password='';SyncPragma=NORMAL;NoWCHAR=0;OEMCP=true;Database="+文件.db
SQLite3直接连的,用了很多年,挺稳的

ehxz 发表于 2023-5-12 19:23:50

路人】Ideason(243711058) 2023-05-12 18:48:03
//不配置ODBC数据源、使用ODBC方式连接数据库
//Access *.mdb
sqlca.DBMS = "ODBC"
sqlca.AutoCommit = False
sqlca.DBParm = "ConnectString='"+&
"Driver=Microsoft Access Driver (*.mdb);"+&
"DBQ=D:\ODBCAccessconnect.mdb;"+&
"UID=;PWD='"

//Access *.mdb, *.accdb
sqlca.DBMS = "ODBC"
sqlca.AutoCommit = False
sqlca.DBParm = "ConnectString='"+&
"Driver=Microsoft Access Driver (*.mdb, *.accdb);"+&
"DBQ=D:\ODBCAccessconnect.accdb;"+&
"UID=;PWD='"

//ASA11
sqlca.DBMS = "ODBC"
sqlca.AutoCommit = False
sqlca.DBParm = "ConnectString='"+&
"Driver=SQL Anywhere 11;"+&
"StartLine=C:\Program Files (x86)\SQL Anywhere 11\Bin32\dbeng11.exe;"+&
"DatabaseFile=C:\Users\Public\Documents\SQL Anywhere 11\Samples\demo.db;"+&
"AutoStop=YES;"+&
"ServerName=local-demo11;"+&
"UserID=DBA;Password=sql'"


//SQL Server
SQLCA.DBMS = "ODBC"
SQLCA.AutoCommit=FALSE
SQLCA.DBParm = "ConnectString= '" +&
    "DRIVER=SQL Server; " +&
    "Database=数据库名称; " +&
    "UID=账号; " +&
    "PWD=密码; " +&
    "Server=地址; "


//SQLite
sqlca.DBMS = "ODBC"
sqlca.AutoCommit = False
sqlca.DBParm = "ConnectString='"+&
"Driver=SQLite3 ODBC Driver;"+&
"Database=D:\demo.db;"+&
"NoCreat=1;"+&
"SyncPragma=NORMAL;NoWCHAR=0;OEMCP=true;"+&
"UserID=DBA;Password=sql'"
加2个(accdb,asa11)
asa12 没测试成功

冷月 发表于 2024-8-26 11:27:09

想要一个mysql的,我写的,要配制odbc
SQLCA.DBMS = "ODBC"
SQLCA.LogPass = ls_dbpassword
SQLCA.ServerName = ls_dbname
SQLCA.LogId = ls_dbuser
SQLCA.AutoCommit = False
SQLCA.DBParm="ConnectString='FileDSN=smp.dsn;UID=" + ls_dbuser + ";PWD=" + ls_dbpassword + "'ConnectOption='SQL_DRIVER_CONNECT,SQL_DRIVER_NOPROMPT' "

swimchen 发表于 2024-9-19 23:16:49

我记得还可以用FILE DSN,但是忘记怎么写了
页: [1]
查看完整版本: pb不配置ODBC数据源、使用ODBC方式连接数据库

免责声明:
本站所发布的一切破解补丁、注册机和注册信息及软件的解密分析文章仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。如有侵权请邮件与我们联系处理。

Mail To:Admin@SybaseBbs.com