#2
hytizj0232023-10-06 17:43
|
PUBLIC erpsql
erpsql=sqlstringconnect("driver=sql server;server=192.168.16.9;uid=sa;pwd=CQCC@123;database=UFDATA_999_2022")
FOR i=1 TO 1
IF erpsql>0
sqlexec(erpsql,"SELECT [sAssetNum],[sAssetname],[sStyle],[sSite],[sDeptNames] FROM fa_Cards where sTypeNum='G2'","ERP_shuju")
SELECT erp_shuju
zjl=RECCOUNT()
SCATTER TO b
d1=b(1)&&固定资产编码
d2=b(2)&&设备名称
d3=b(3)&&规格型号
d4=b(4)&&存放地点
d5=b(5)&&使用部门
ziduan='固定资产编码,设备名称,规格型号'
sqlexec(nHandle,"insert into ERP_zhb ("+ziduan+") values('&d1','&d2','&d3')")
ELSE
MESSAGEBOX('连接数据失败,请联系管理员',64,'系统提示')
EXIT
ENDIF
ENDFOR
thisform.Release
提示sqlexec(nHandle,"insert into ERP_zhb ("+ziduan+") values('&d1','&d2','&d3')")这句有错,错在规格型号
都是nvarchar(50)类型,我实在找不到错在哪里,不加规格型号都没问题。