x


Can't Connect to SQLite after Build.....

I have problem about between SQLite and Unity.. look below:

http://dl.dropbox.com/u/563640/UnityWeb/UnityForum/InEditor.jpg In Unity Editor (Working)

alt text After Build, Unity Web player (Not Work)

I tested on HTTP and localhost and root folder...

Why its not showing up in webplayer after build? Did i miss something? or something wrong with DLL file? :confused: and my script look below:

here script:

using UnityEngine;
using Mono.Data.SqliteClient;
using System;
using System.Data;
using System.Collections;
using System.Collections.Generic;

public class SQLiteServer : MonoBehaviour {

    private static IDbConnection dbcmd;

    private D jsScript;

    // Use this for initialization
    void Start () {
        jsScript = GameObject.Find("GUI Text").GetComponent<D>(); //Debug mode

        string connectionString = "URI="+ Application.dataPath + "/test.db"; // directory for MAC

        jsScript.msg = "Prepare Connect...";

        IDbConnection conn;

        conn = new SqliteConnection(connectionString);

        jsScript.msg = "Prepare Connect 2..."; //Stuck in Webplayer

        conn.Open();

        print("Connection: " + conn.State);
        jsScript.msg = "Connection: " + conn.State; //No Show... 

        IDbCommand dbcmd = conn.CreateCommand();

I did put DLL to ../Assets/Libraries/:

  • I18N.dll
  • I18N.West.dll
  • Mono.Data.SqliteClient.dll
  • sqlite3.dll System.Configuration.dll
  • System.Data.dll System.Drawing.dll
  • System.EnterpriseServices.dll
  • System.Security.dll
more ▼

asked Apr 06 '11 at 04:30 PM

alienx2 gravatar image

alienx2
76 5 5 12

I'm using SQL Server as the database, and I have exactly the same problem. It has kept bothering me for long. If you have sloved it, let me know, please.

Apr 20 '11 at 05:51 AM Boxer

Just now I worked it out finally!

Since I'm using a Chinese version SQL Server 2008, I need a I18N.CJK.dll(China,Japan,Korea) besides I18N.West.dll and I18N.dll under Assets folder. It works well now. Wish it could help for you. Just add a I18N.your country.dll will help.

Apr 20 '11 at 06:51 AM Boxer
(comments are locked)
10|3000 characters needed characters left

3 answers: sort voted first

The web player doesn't allow local file access. Thus a SQLLite database will never open if accessed through a web player.

It's a security restriction of the web player. You'll need to store your data in PlayerPrefs or via a web service.

more ▼

answered Dec 05 '12 at 11:04 AM

Meltdown gravatar image

Meltdown
5.6k 18 25 49

(comments are locked)
10|3000 characters needed characters left

SQLiteKit asset could help you to manage your SQLite3 database even on web! That library has examples how to run it.

more ▼

answered Dec 14 '12 at 06:01 PM

Oksana Iashchuk gravatar image

Oksana Iashchuk
61 2

interesting

Dec 14 '12 at 06:51 PM Meltdown
(comments are locked)
10|3000 characters needed characters left

HI for the Sqlite problem it seems to be that you must add SQlite3 this is the driver put it youProjectName/ and evrey thing will be all right :)

more ▼

answered Apr 24 '11 at 10:01 PM

GamerUnity gravatar image

GamerUnity
-3

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x684
x241
x66
x54

asked: Apr 06 '11 at 04:30 PM

Seen: 1510 times

Last Updated: Dec 14 '12 at 06:51 PM