Simple DB process method in program

Simple DB process method in program,第1张

概述Used to process simple DB in Windows by using Python, C++ and C# before, the DB was Microsoft Access and SQLite. 1, Python to import DB to Microsoft Access, code as below, for illustration only, conn

Used to process simple DB in windows by using Python,C++ and C# before,the DB was Microsoft Access and sqlite.

1,Python to import DB to Microsoft Access,code as below,for illustration only,

conn = win32com.clIEnt.dispatch("ADODB.Connection")DSN="ProvIDer=Microsoft.Jet.olEDB.4.0;Data Source=" + dbconn.Open(DSN)insertfmt = "sql command here"sql = insertfmt.format("prepare the data here")conn.Execute(sql) //execute sql command

2,C# to create and insert sqlite db,
sqliteConnection.Createfile(dbfilename);conn = new sqliteConnection("Data Source=" + dbfilename);conn.open();cmd.CommandText ="put your sql command here";cmd.ExecuteNonquery(); //execute command

3,C++sqliteEncrypt,
Cppsqlite3DB db;db.open(gszfile); //gszfile is the db name and location// supply password key after db file opened db.key("123456789",(int)strlen("123456789"));// reset / change your password phrase on the flydb.rekey("987654321",(int)strlen("987654321"));Cppsqlite3table t1 = db.gettable("SELECT * FROM APDU;");//display the table contentfor (fld = 0; fld < t1.numFIElds(); fld++){	cout << t1.fIEldname(fld) << "|";}
总结

以上是内存溢出为你收集整理的Simple DB process method in program全部内容,希望文章能够帮你解决Simple DB process method in program所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/sjk/1166544.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-01
下一篇 2022-06-01

发表评论

登录后才能评论

评论列表(0条)

保存