代码真是自己写的,就是SPT调用ACCESS数据的时候用了一点别人的代码;
riqi=TTOD(thisform.t1._Value)
nhandle=Sqlstringconnect("Driver={Microsoft Access Driver (*.mdb)}; Dbq=e:油库其他\付油\data1.mdb;Pwd=")
IF
nhandle<=0
MESSAGEBOX("数据库连接失败!!!",16,
'错误信息')
RETURN
ELSE
*Ac=SQLEXEC(nhandle,"Select * From fypz where cprq=?riqi","Temp1")
Ac=SQLEXEC(nhandle,"Select hwh,SUM(yfss) as yfss1,SUM(sfss) as sfss1 From fypz where cprq=?riqi group by hwh","Temp1")
IF
Ac<0
MESSAGEBOX("读取数据错误!",16,
'错误信息')
RETURN
ENDIF
SELECT
Temp1
= SQLDISCONNECT(nhandle)
ENDIF