Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6535467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T10:22:37+00:00 2026-05-25T10:22:37+00:00

The database has opened, and the table has created. But I can’t Insert record,

  • 0

The database has opened, and the table has created. But I can’t Insert record, I’m useing mozilla sqlite storage:

Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource://gre/modules/FileUtils.jsm");
let file = FileUtils.getFile("ProfD", ["filef.sqlite"]);
let dbconn = Services.storage.openDatabase(file);
dbconn.executeSimpleSQL('CREATE TABLE IF NOT EXISTS "quicklink" ("id" INTEGER PRIMARY KEY NOT NULL , "name" VARCHAR NOT NULL , "href" VARCHAR NOT NULL )');
var sqlinsert=dbconn.createStatement('INSERT INTO "quicklink" ("name","href") VALUES (:name,:href)');
sqlinsert.params.name = "Something";
sqlinsert.params.href = "URL";
dbconn.close();

I don’t get any error(s) in firebug console, or whit the try{}catch(){} statement. Why? What is the problem whit it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T10:22:38+00:00Added an answer on May 25, 2026 at 10:22 am
    1. In general, you CANNOT do database access from client-side Javascript.

      There are many exceptions (for example, maybe you’re using Node.js on a server, or maybe you’re using HP WebOS on a local Sqlite database), but I didn’t see anything in your post about your environment or database connectivity.

    2. Assuming you CAN legitimately connect to a database with Javascript in your environment, I don’t see where you’re executing the prepared SQL statement.

    Suggestions:

    1. Please specify the database and database library you’re using

    2. Please show us the “execute” statement and corresponding error handler

    3. Please cut/paste any error messages you’re getting in the error handler or in the database log.

    ADDENDUM:

    OK – I’m with you now:

    1) You’re using the Mozilla “Storage” API.

    2) You need to call “executeStatement()” after your “createStatement()”.

    3) You should also have a “handleError” function.

    The documentation and sample code is here:

    http://developer.mozilla.org/En/Storage

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the following my SQLite database has 10 values in each table. However, when
My database schema has a 'locked' setting meaning that the entry can not be
Suppose a database table has a column Name which is defined as key for
I inherited MYSQL database that has lots of tables with data like CREATE TABLE
How to tell using T-SQL whether a SQL server database has the TRUSTWORTHY property
In Microsoft SQL Server, is there a way to detect whether a database has
I have a database that has a vessel pressure that is trended every 30
I have a database that has lots of data and is all neat, normalized
I have a database that has four columns like this level_1, level_2, level_3, level_4
I have a mysql database which has grown to over 200 tables in it.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.