Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共4 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:[求助]PEL数据库编程问题

1楼
z7c9 发表于:2010/12/12 15:17:10

runmode:0;

database('provider=microsoft.jet.oledb.4.0;data source=d:\test.mdb');

dbexecute('insert into Test(stockdate) values('+numtostr(date,0)+')');

dbexecute('insert into Test(stockdate,stockopen,stockhigh,stocklow,stockclose,stockvolume) values('+numtostr(date,0)+','+numtostr(open,0)+','+numtostr(high,0)+','+numtostr(low,0)+','+numtostr(close,0)+','+numtostr(vol,0)+')');

 

 

红色语句成功插入数据,而绿色语句没有成功插入数据,怎么回事?

 

test.mdb 在 http://u.115.com/file/t8f2a7ec31

[此贴子已经被作者于2010-12-12 15:24:49编辑过]
2楼
admin 发表于:2010/12/12 16:03:29

使用DEBUGFILE输出字符串看看,一般是SQL语句的语法问题或者数据库字段填写不正确。

3楼
z7c9 发表于:2010/12/12 17:28:30

runmode:0;

database('provider=microsoft.jet.oledb.4.0;data source=d:\dbdemo\test.mdb');
sql:='insert into test(stockdate,stockopen,stockhigh,stocklow,stockclose,stockvolume) values('+numtostr(date,0)+','+numtostr(open,0)+','+numtostr(high,0)+','+numtostr(low,0)+','+numtostr(close,0)+','+numtostr(vol,0)+')';
dbexecute(sql);

 

已成功插入,不过stockdate怎么是这样的?怎么把日期正确插入?谢谢

 

 

 

 

4楼
z7c9 发表于:2010/12/13 9:35:23
图片点击可在新窗口打开查看
共4 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.03125 s, 3 queries.