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起来 【路人】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直接连的,用了很多年,挺稳的
路人】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 没测试成功
想要一个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' " 我记得还可以用FILE DSN,但是忘记怎么写了
页:
[1]