当前位置 : MySQL中文实验室首页 >
技术资料 >
PB连接mysql
PB连接mysql
通过ODBC连接, 最新的ODBC版本是5.1.4, 代码如下:
// Profile
SQLCA.DBMS = "ODBC"
SQLCA.AutoCommit = False
//SQLCA.DBParm = "ConnectString='DSN=miwarflock;UID=root;PWD='" //用DSN
connect Using SQLCA;
if SQLCA.SQLCode <> 0 then
if gs_language = 'C' then
MessageBox('联结MIWA 数据库失败','错误代码: '+string(sqlca.sqlcode)+', '+SQLCA.SQLErrText)
else
messagebox('Link MIWA Database Error','Error Code: '+string(sqlca.sqlcode)+', '+sqlca.sqlerrtext)
end if
halt
end if
// Profile
SQLCA.DBMS = "ODBC"
SQLCA.AutoCommit = False
//SQLCA.DBParm = "ConnectString='DSN=miwarflock;UID=root;PWD='" //用DSN
connect Using SQLCA;
if SQLCA.SQLCode <> 0 then
if gs_language = 'C' then
MessageBox('联结MIWA 数据库失败','错误代码: '+string(sqlca.sqlcode)+', '+SQLCA.SQLErrText)
else
messagebox('Link MIWA Database Error','Error Code: '+string(sqlca.sqlcode)+', '+sqlca.sqlerrtext)
end if
halt
end if


0条网友评论:
添加评论: