Foxpro DBF数据库转换成SQL Server (4)
2015-06-22 01:00
导读:iffield_dec=0 iffield_len8 sql_com=sql_com+int else sql_com=aql_com+float endif else sql_com=sql_com+float endif casefield_type=D sql_com=sql_com+datatime casefield_type=M sql_com=sql_com+text casefie
if field_dec=0
if field_len<8
sql_com=sql_com+"int "
else
sql_com=aql_com+"float "
endif
else
sql_com=sql_com+"float "
endif
case field_type="D"
sql_com=sql_com+"datatime "
case field_type="M"
sql_com=sql_com+"text "
case field_type="G"
sql_com=sql_com+"binary "
endcase
skip
if .not.eof()
sql_com=sql_com+","
endif
enddo
sql_com=aql_com+" )"
success=dbexec(handle,sql_com)
if success
wait wind "SQL Server表已建立成功! "
else
wait wind "SQL Server表建立失败! "
endif
close all
clear all
retu
else && 若连接不成功
wait wind "对不起,输入参数错误,无法连接SQL Server'
clear read
retu
endif
(3)、再执行Foxpro程序conv_data将数据由.dbf传输到SQL Server表中。
conv_data.prg 程序清单
conv_data.prg 程序清单
set talk off
close all
clear all