是否可以使用代码在表中插入当前时间datestr(now);
?
我收到此错误:
Error using database/fastinsert (line 86) Input data must be a cell array, matrix, or structure
Error in licenseplate>pushbutton23_Callback (line 615) fastinsert(conn,tableName,colnames2,txt);
在命令窗口中。
这是代码:
conn = database('vlmsystem','admin','admin');
dbpath = 'C:\Users\Sony Vaio\Documents\Task\0.1 Systems\System 1 - edited\Appendix\vlogdbase.mdb';
tableName = 'vehicleLog';
colnames = {'plate_number','date_time','login_logout'};
colnames1 = {'plate_number'};
colnames2 = {'date_time'};
colnames3 = {'login_logout'};
txt = datestr(now);
fastinsert(conn,tableName,colnames2,txt);
close(conn);
使用 txt = {datestr(now)} 编辑:
我收到了这个错误,它没有在表格中记录日期。
车牌
txt =
'25-Oct-2013 02:03:59'
Error using database/datainsert (line 129)
Unable to insert element in row 1 column 1, 25-Oct-2013 02:03:59.
Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]
Error in licenseplate>pushbutton23_Callback (line 615)
datainsert(conn,tableName,colnames2,txt);