从 IIS 服务器托管时,HTML5 Web SQL 数据库插入表失败
当托管在本地 IIS 7 服务器上时,插入表将不起作用。然而,当从 Visual Studio 2010 中通过 ASP.NET 开发服务器运行时,它将起作用。数据库和表已创建,但 INSERT 查询似乎什么也不做。我没有从执行 INSERT 查询本身中收到任何错误消息,并且事务没有失败。我正在使用 Safari 浏览器和 Safari 的 Inspect Element 来尝试调试该问题。任何想法将不胜感激。参见代码:
try {
systemDB.transaction(function (tx) {
tx.executeSql('INSERT INTO tblReminders (fldForeignId, fldReminderContent, fldReminderDate, fldActioned, fldReminderTime, fldSubject, fldDueDate, fldBusinessBaseId, fldMobileRecipientsOnly, fldSendToCoordinator, fldPersonIds) ' +
'VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);', [foreignId, reminderContent, reminderDate, actioned, reminderTime, subject, dueDate, businessBaseId, mobileRecipientsOnly, sendToCoordinator, personIds], dataHandler, sqlErrorHandler);
}, myTransactionErrorCallback, myTransactionSuccessCallback("INSERT INTO tblReminders:"));
} catch (e) {
alert(getDatabaseErrorCodes(-1, e));
return;
}
The INSERT into table will not work when hosted on a Local IIS 7 server. However it will work when running through the ASP.NET Development Server from Visual Studio 2010. The database and table are created but the INSERT query seems to just do nothing. I'm not getting any error messages back from executing the INSERT query itself and the transaction is not failing. I'm using the Safari browser and Safari's Inspect Element to try and debug the issue. Any ideas would be greatly appreciated. See code:
try {
systemDB.transaction(function (tx) {
tx.executeSql('INSERT INTO tblReminders (fldForeignId, fldReminderContent, fldReminderDate, fldActioned, fldReminderTime, fldSubject, fldDueDate, fldBusinessBaseId, fldMobileRecipientsOnly, fldSendToCoordinator, fldPersonIds) ' +
'VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);', [foreignId, reminderContent, reminderDate, actioned, reminderTime, subject, dueDate, businessBaseId, mobileRecipientsOnly, sendToCoordinator, personIds], dataHandler, sqlErrorHandler);
}, myTransactionErrorCallback, myTransactionSuccessCallback("INSERT INTO tblReminders:"));
} catch (e) {
alert(getDatabaseErrorCodes(-1, e));
return;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
由于这是本地 Web 数据库,因此应该进行插入。这应该独立于服务器。
Q1:您遇到的错误是什么?
Q2:您是否正确打开数据库?
executeSQL 方法需要以下格式的输入,
如果您没有类似的内容,我建议将以下内容作为错误回调:
Since this is a local web database, the insert should happen. This should be independent of the server.
Q1: What is the error you are getting?
Q2: Are you opening the database correctly?
The executeSQL method requires the inputs in the following format
I suggest the following as the error callback if you don't have something similar: