import win.ui;
/*DSG{{*/
mainForm = win.form(text="aardio工程17";right=959;bottom=591)
mainForm.add(
edit={cls="edit";text="Edit";left=351;top=132;right=814;bottom=504;edge=1;multiline=1;z=1};
listview={cls="listview";left=47;top=110;right=252;bottom=486;edge=1;z=3};
static={cls="static";text="access to sqlite";left=283;top=25;right=712;bottom=91;color=255;font=LOGFONT(h=-29);notify=1;transparent=1;z=2}
)
/*}}*/
//使用SQL操作excel
import access;
import sqlite
//打开数据库,如果不存在就自动创建
var db = access("D:/123.mdb") //也可以直接写数据库连接串 http://www.connectionstrings.com/excel/
for(rs,fields in db.each("SELECT * FROM avatar_news") ){
//console.log( rs("url").value,rs("comment").value )
mainForm.edit.text=mainForm.edit.text+rs("title").value;
var sqldb = sqlite("D:/123.db")
var command = sqldb.prepare("REPLACE INTO ay_content VALUES (null,@acode,@scode,@subscode,@title,@titlecolor,@subtitle,@filename,@author,@source,@outlink,@date,@ico,@pics,@content,@tags,@enclosure,@keywords,@description,@sorting,@status,@istop,@isrecommend,@isheadline,@visits,@likes,@oppose,@create_user,@update_user,@create_time,@update_time,@gtype,@gid,@gnote);" ) ;
command.step(
acode = 'cn';
scode = '11';
subscode = '';
title = rs("title").value;
titlecolor = '';
subtitle = rs("info").value;
filename = '';
author = '';
source = "admin";
outlink = '本站';
date = '';
ico = rs("pic").value;
pics = '';
content = rs("content").value;
tags = '';
enclosure = '';
keywords = rs("keywords").value;
description = rs("description").value;
sorting = '255';
status = '1';
istop = '0';
isrecommend = '0';
isheadline = '0';
visits = '128';
likes = '0';
oppose = '0';
create_user = 'admin';
update_user = 'admin';
create_time = time.now();
update_time = time.now();
gtype = '4';
gid = '';
gnote = '';
)
}
//关闭数据库
//db.close();
//console.pause();
mainForm.edit.oncommand = function(id,event){
}
mainForm.listview.onnotify = function(id,code,ptr){
}
mainForm.static.oncommand = function(id,event){
}
mainForm.show();
return win.loopMessage();