long ll_rc
string ls_err
// Define database transaction
transaction ltrn_source
transaction ltrn_target
ltrn_source=create transaction
//Define the parameters necesary to connect to the database
ltrn_source.DBMS="ODBC"
ltrn_source.DBParm="connectString='DSN=pbperson" + ";UID=dba;pwd=sql;'"
ltrn_target=create transaction
ltrn_target=create transaction
ltrn_target.DBMS="ODBC"
ltrn_target.DBParm="ConnectString='DSN=Oldperson;" + "UID=dba;PWD=sql;'"
lpipe_customer = Create u_pip_menupl_to_fox
lpipe_customer.ist_rowsread = st_read
lpipe_customer.ist_rowswritten = st_written
lpipe_customer.DataObject = "transfer_data_menupl"
Connect Using ltrn_source;
if ltrn_source.sqlcode < 0 then
messageBox ('Source database', 'Could Not Connect' + '~r~nSQLDBCode: ' + &
String (ltrn_source.SQLDBCODE) + '~r~nSQLErrText: ' + &
ltrn_Source.SQLErrText)
Else
Connect Using ltrn_target;
if ltrn_target.sqlcode < 0 then
messageBox ('Target database', 'Could Not Connect' + '~r~nSQLDBCode: ' + &
String (ltrn_Target.SQLDBCODE) + '~r~nSQLErrText: ' + &
ltrn_Target.SQLErrText)
else
MessageBox("Information","此程序大約30分鐘,如果停止請選Cancel")
ll_rc=lpipe_customer.start(ltrn_source,ltrn_target,dw_1)
if ll_rc < 0 then
CHOOSE CASE ll_rc
CASE -1
ls_err='Pipe open failed'
CASE -2
ls_err='Too many columns'
CASE -3
ls_err='Table already exist'
CASE -4
ls_err='Table does not exist'
CASE -5
ls_err='missing connection'
CASE -6
ls_err='Wrong arguments'
CASE -7
ls_err='Column mismatch'
CASE -8
ls_err='Fatal SQL error in source'
CASE -9
ls_err='Fatal SQL error in destination'
CASE -10
ls_err='Maximum number of errors exceeded'
CASE -11
ls_err='Bad table syntax'
CASE -12
ls_err='Bad table syntax'
CASE -13
ls_err='Key required but not supplied'
CASE -14
CASE -15
ls_err='Pipe already in proress'
CASE -16
ls_err='Error in source database'
CASE -17
ls_err='Error in destination databse'
CASE -18
ls_err='Destination database is read-only'
END CHOOSE
MessageBox ('Pipline','Rows Read :'+ String (lpipe_customer.RowsRead) + &
'~r~nRows Written:' + &
String (lpipe_customer.RowsWritten))
end if
end if
end if
Destroy lpipe_customer
Destroy ltrn_source
destroy ltrn_target
MessageBox("information","資料傳輸完成!")
提示以下錯誤:不能連接;sqldbccode:999;sqlerrtext:sqlstate=IM002;未發現資料源并且未指定默認驅動程式。
請問怎么解決?謝謝
uj5u.com熱心網友回復:
資料庫連接驅動問題吧轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/106300.html
標籤:數據庫相關
