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=" + db conn.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 fly db.rekey("987654321",(int)strlen("987654321")); CppSQLite3Table t1 = db.getTable("SELECT * FROM APDU;"); //display the table content for (fld = 0; fld < t1.numFields(); fld++) { cout << t1.fieldName(fld) << "|"; }
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。