Sqlite problem with opening database

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Sqlite problem with opening database

Gregor Pavuna
Good day,

 

I'm turning on you, since i have no general idea how to solve this. I
googled a lot of similar questions and tried them all, but without success.
I tried to compile to x86 only, prefer 32bit only, .

 

Let me explain my situation:

Application was built for Any CPU and is supposed to work on both x86 and
x64 OS windows. And in most of the cases it works like a charm. Application
is stored on a server and clients map drives and run applications from
mapped drives (processes are hosted locally on each OS). In some cases where
client is x86 application throws next error:

 

System.BadImageFormatException: An attempt was made to load a program with
an incorrect format. (Exception from HRESULT: 0x8007000B)

   at
System.Data.SQLite.UnsafeNativeMethods.sqlite3_config_none(SQLiteConfigOpsEn
um op)

   at System.Data.SQLite.SQLite3.StaticIsInitialized()

   at System.Data.SQLite.SQLiteLog.Initialize()

   at System.Data.SQLite.SQLiteConnection..ctor(String connectionString,
Boolean parseViaFramework)

   at System.Data.SQLite.SQLiteConnection..ctor()

   at
EArhiv.EArhivLocalStorageDataSetTableAdapters.FailedToSendTableAdapter.InitC
onnection()

   at
EArhiv.EArhivLocalStorageDataSetTableAdapters.FailedToSendTableAdapter.get_C
onnection()

   at
EArhiv.EArhivLocalStorageDataSetTableAdapters.FailedToSendTableAdapter.InitC
ommandCollection()

   at
EArhiv.EArhivLocalStorageDataSetTableAdapters.FailedToSendTableAdapter.get_C
ommandCollection()

   at
EArhiv.EArhivLocalStorageDataSetTableAdapters.FailedToSendTableAdapter.FillU
nsent(FailedToSendDataTable dataTable)

   at EArhiv.Form1.Osvezi()

 

But that happens only on some of the x86 systems. When i tried to run for
debugging purposes on PCs that have windows 7 x86 and windows 10 x86 it
works (It works if i copy files localy on those PC's, but if i try to open
application from mapped drive than it won't work).

 

Have you ever faced similar problems? Please help!

 

Looking forward to hearing from you!

 

Best regards,

 

Gregor

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sqlite problem with opening database

Simon Slavin-3


On 5 Jul 2017, at 8:36am, Gregor Pavuna <[hidden email]> wrote:

> System.BadImageFormatException: An attempt was made to load a program with
> an incorrect format. (Exception from HRESULT: 0x8007000B)

Obtain and log the properties of this error:

<https://msdn.microsoft.com/en-us/library/system.badimageformatexception(v=vs.110).aspx>

Also see "Remarks" on that page for examples of what might be causing the error.

My guess is that you’re mixing 32-bit and 64-bit App and library, or something of the sort.

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sqlite problem with opening database

Gregor Pavuna
In reply to this post by Gregor Pavuna
Hey Simon, no i am not mixing, because it works on most of the clients 32bit and 64bit. That one is exception (well on several PCs, two different clients).

As it seems there's some sort of server problem(Windows 2012 server). My guess is server is caching 64bit files and serving them to 32bit operating systems. I tested on my test server with laptop (32bit windows 7) and it works fine. Than i went to client and connected laptop there and it didn't work with their files.

I also googled that out, but couldn't find anything on that topic. Any suggestions?

Gregor.



On 5 Jul 2017, at 8:36am, Gregor Pavuna <[hidden email]> wrote:

> System.BadImageFormatException: An attempt was made to load a program
> with an incorrect format. (Exception from HRESULT: 0x8007000B)

Obtain and log the properties of this error:

<https://msdn.microsoft.com/en-us/library/system.badimageformatexception(v=vs.110).aspx>

Also see "Remarks" on that page for examples of what might be causing the error.

My guess is that you’re mixing 32-bit and 64-bit App and library, or something of the sort.

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sqlite problem with opening database

Simon Slavin-3


On 5 Jul 2017, at 1:41pm, Gregor Pavuna <[hidden email]> wrote:

> As it seems there's some sort of server problem(Windows 2012 server). My guess is server is caching 64bit files and serving them to 32bit operating systems. I tested on my test server with laptop (32bit windows 7) and it works fine. Than i went to client and connected laptop there and it didn't work with their files.

You are keeping your application on a server ?  Or a library ?  Does the problem go away if you keep your application and libraries on the client computer instead ?

> I also googled that out, but couldn't find anything on that topic. Any suggestions?

Whatever the problem, it seems that it’s related to the Windows application loading system, not SQLite.  So you might find another forum is able to help you better than this one.

Simon.
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sqlite problem with opening database

Paul Sanderson
Could your 32 bit app be picking up a 64 bit dll. Could you rename the
dll's and hard code the location into your library?

May not work for your release code but may help you narrow down the issue.

Paul


On Wed, 5 Jul 2017 at 18:19, Simon Slavin <[hidden email]> wrote:

>
>
> On 5 Jul 2017, at 1:41pm, Gregor Pavuna <[hidden email]> wrote:
>
> > As it seems there's some sort of server problem(Windows 2012 server). My
> guess is server is caching 64bit files and serving them to 32bit operating
> systems. I tested on my test server with laptop (32bit windows 7) and it
> works fine. Than i went to client and connected laptop there and it didn't
> work with their files.
>
> You are keeping your application on a server ?  Or a library ?  Does the
> problem go away if you keep your application and libraries on the client
> computer instead ?
>
> > I also googled that out, but couldn't find anything on that topic. Any
> suggestions?
>
> Whatever the problem, it seems that it’s related to the Windows
> application loading system, not SQLite.  So you might find another forum is
> able to help you better than this one.
>
> Simon.
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
--
Paul
www.sandersonforensics.com
skype: r3scue193
twitter: @sandersonforens
Tel +44 (0)1326 572786
http://sandersonforensics.com/forum/content.php?195-SQLite-Forensic-Toolkit
-Forensic Toolkit for SQLite
email from a work address for a fully functional demo licence
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sqlite problem with opening database

Chris Locke-3
This is actually answered on the system.data.sqlite download page.
https://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki

Scroll down to the section, "Using Native Library Pre-Loading".
For some reason (?) on Chrome the text is about 30pt, so you shouldn't be
able to miss it.
Essentially, it says to have the DLLs in the right directory, underneath
the application.

<bin>\App.exe (optional, managed-only application executable assembly)
<bin>\App.dll (optional, managed-only application library assembly)
<bin>\System.Data.SQLite.dll (required, managed-only core assembly)
<bin>\System.Data.SQLite.Linq.dll (optional, managed-only LINQ assembly)
<bin>\System.Data.SQLite.EF6.dll (optional, managed-only EF6 assembly)
<bin>\x86\SQLite.Interop.dll (required, x86 native interop assembly)
<bin>\x64\SQLite.Interop.dll (required, x64 native interop assembly)

Some SQL command you're firing off requires the use of the DLL, and some of
your clients are set up correctly (or have that DLL on their system) while
others don't.  Its an easy fix.


Thanks,
Chris

On Thu, Jul 6, 2017 at 1:55 PM, Paul Sanderson <[hidden email]
> wrote:

> Could your 32 bit app be picking up a 64 bit dll. Could you rename the
> dll's and hard code the location into your library?
>
> May not work for your release code but may help you narrow down the issue.
>
> Paul
>
>
> On Wed, 5 Jul 2017 at 18:19, Simon Slavin <[hidden email]> wrote:
>
> >
> >
> > On 5 Jul 2017, at 1:41pm, Gregor Pavuna <[hidden email]> wrote:
> >
> > > As it seems there's some sort of server problem(Windows 2012 server).
> My
> > guess is server is caching 64bit files and serving them to 32bit
> operating
> > systems. I tested on my test server with laptop (32bit windows 7) and it
> > works fine. Than i went to client and connected laptop there and it
> didn't
> > work with their files.
> >
> > You are keeping your application on a server ?  Or a library ?  Does the
> > problem go away if you keep your application and libraries on the client
> > computer instead ?
> >
> > > I also googled that out, but couldn't find anything on that topic. Any
> > suggestions?
> >
> > Whatever the problem, it seems that it’s related to the Windows
> > application loading system, not SQLite.  So you might find another forum
> is
> > able to help you better than this one.
> >
> > Simon.
> > _______________________________________________
> > sqlite-users mailing list
> > [hidden email]
> > http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
> >
> --
> Paul
> www.sandersonforensics.com
> skype: r3scue193
> twitter: @sandersonforens
> Tel +44 (0)1326 572786
> http://sandersonforensics.com/forum/content.php?195-SQLite-
> Forensic-Toolkit
> -Forensic Toolkit for SQLite
> email from a work address for a fully functional demo licence
> _______________________________________________
> sqlite-users mailing list
> [hidden email]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Loading...