Unable to connect to SQLite database
显示 更早的评论
I am unable to use sqlite to connect to databases that have worked previously for me in Matlab and currently work in R. The command:
conn = sqlite(dbfile);
yields the error:
"Error using sqlite
Received exception upon attempting an operation. Exception: [Unable to open the database. (unable to open database file)]. Details:
[connect(~/*.db)]."
The command
isfile(dbfile)
confirms that the file exists.
I tried using the example tutorial SQLiteWorkflow.m, but received an error:
"Error using sqlite
SQLite file exists.
Error in SQLiteWorkflow (line 18)
conn = sqlite('tutorial.db', 'create');"
Any ideas on how to get sqlite working for me again?
5 个评论
Walter Roberson
2019-3-21
What is the content of dbfile ?
As for the tutorial: it looks like you ran it before and the tutorial.db already exists. You could delete it to rerun the tutorial.
Annette Hynes
2019-3-21
编辑:Annette Hynes
2019-3-21
Walter Roberson
2019-3-21
After you
openExample('database/WorkWithDataMATLABInterfaceToSQLiteExample')
what shows up for pwd() ? And when you ls() which files do you see there?
Walter Roberson
2019-3-21
My question about dbfile was asking about what the character vector stored in the variable dbfile is -- the path to the database you are trying to connect to.
Annette Hynes
2019-3-22
采纳的回答
更多回答(1 个)
Annette Hynes
2019-3-21
2 个评论
Walter Roberson
2019-3-21
Unfortunately with the new editor, these boxes to enter in comments etc. do not show up as text boxes for the purposes of browsers, so browsers do not enable menu items for copying and pasting.
You appear to be using Mac. If you are not up to date on your Firefox, you might possibly be able to use command-V to paste into these boxes. However that will probably fail if you are up to date on Firefox. If you use Safari then command-V will work (at least for now...)
Annette Hynes
2019-3-21
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB Interface to SQLite 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!