在网上找的“DevartODBCSQLite.exe”建立的ODBC连接
-------------------------
CLEAR
_Dir=SET("DEFAULT") + SYS(2003) + "\"
_SQL=SQLSTRINGCONNECT("Driver=Devart ODBC Driver for SQLite;database="+_Dir+"jxc.db")
IF !USED('jhxx')
USE jhxx ALIAS jhxx IN 0
ENDIF
*-表字段和数据库字段类型不一致,怀疑由此导致不能批量插入,期望老师们讲解。
*?SQLEXEC(_SQL,"INSERT INTO id,sales_standing_book (agricultureno,productsName,companyName,specification,salesAmounts,buyers,salesDate) SELECT pdno as 'id',pdno,goods,company,spec,quantity,supplier,lrsj FROM jhxx")
SELECT jhxx
GOTO TOP
DO WHILE !EOF()
a0 = pdno &&数据库ID字段作为主键,内容不能空且重复
a1 = pdno
a2 = goods
a3 = company
a4 = spec
a5 = quantity
a6 = supplier
a7 = lrsj
?SQLEXEC(_SQL,"INSERT INTO sales_standing_book (id,agricultureno,productsName,companyName,specification,salesAmounts,buyers,salesDate) VALUES (?a0,?a1,?a2,?a3,?a4,?a5,?a6,?a7)")
SKIP +1
ENDDO
?SQLEXEC(_SQL,"select id,agricultureno,productsName,companyName,specification,salesAmounts,buyers,salesDate from sales_standing_book")
BROWSE
-------------------------
CLEAR
_Dir=SET("DEFAULT") + SYS(2003) + "\"
_SQL=SQLSTRINGCONNECT("Driver=Devart ODBC Driver for SQLite;database="+_Dir+"jxc.db")
IF !USED('jhxx')
USE jhxx ALIAS jhxx IN 0
ENDIF
*-表字段和数据库字段类型不一致,怀疑由此导致不能批量插入,期望老师们讲解。
*?SQLEXEC(_SQL,"INSERT INTO id,sales_standing_book (agricultureno,productsName,companyName,specification,salesAmounts,buyers,salesDate) SELECT pdno as 'id',pdno,goods,company,spec,quantity,supplier,lrsj FROM jhxx")
SELECT jhxx
GOTO TOP
DO WHILE !EOF()
a0 = pdno &&数据库ID字段作为主键,内容不能空且重复
a1 = pdno
a2 = goods
a3 = company
a4 = spec
a5 = quantity
a6 = supplier
a7 = lrsj
?SQLEXEC(_SQL,"INSERT INTO sales_standing_book (id,agricultureno,productsName,companyName,specification,salesAmounts,buyers,salesDate) VALUES (?a0,?a1,?a2,?a3,?a4,?a5,?a6,?a7)")
SKIP +1
ENDDO
?SQLEXEC(_SQL,"select id,agricultureno,productsName,companyName,specification,salesAmounts,buyers,salesDate from sales_standing_book")
BROWSE