Spanish DataBase sqlite problem after compiler

Maki25

Member
Licensed User
Longtime User
Hi,

when I have finished my program with sqlite database, I've compiled. But I have a problem when I run the compiled program gives me an error in the sub connection of database, "an error occurred on sub_main connect_clubs -> Object reference not set to an instance of an object, Continue?"
I thought we had put the database in a wrong folder, but I've put in the same place that I have run the program.
The program also opens photos in a folder called icons and opens smoothly.
My problem is how to open the database without me wrong, because the program works well without being compiled ..

Sorry about my English, is translated with a translator ..
 

Maki25

Member
Licensed User
Longtime User
Could you post the source code (better all of it, but you can post just the part causing the problem)?

Hi Ariel

I think my problem is not the code. The program works well on the desktop and editor of device.
When I compile it gives me no error, only when I run either Windows XP or in Windows Mobile 6.1 gives me error: "An error occurred on sub_main connect_clubs -> Object reference not set to an instance of an object, Continue?" This message appears every time the program makes a query to the database :BangHead:

It is as if not find the path to the database or could not connect. I tried moving the file from the database where I have compiled the program either.


I wonder do I open the image files and the database do not open ...

If I compile the same program but without access to a database after I compile it works fine, but database not functioning.

Thanks for trying to help Ariel
 

Ariel_Z

Active Member
Licensed User
It is very strange, maybe if I see the code I would be able to help more. The error message is thrown from somewhere below, so it is not very helpful alone in this case. Did you try to add some msgboxes to see important vars?
 

Maki25

Member
Licensed User
Longtime User
It is very strange, maybe if I see the code I would be able to help more. The error message is thrown from somewhere below, so it is not very helpful alone in this case. Did you try to add some msgboxes to see important vars?

Hi Ariel_Z


this is the code for connect to data base;

Sub App_Start
form1.show
TIMER1.Enabled =True
listbox1.Clear
textbox1.text="0"
textbox2.text="0"
textbox3.text="0"
textbox4.text="0"
LR.Text=""
label11.Color=128,255,0
label12.Color=128,255,0
label13.Color=128,255,0
label14.Color=128,255,0
connectCLUBS 'This is the point where failure mark
iftablenotexist 'I continued, and I mark this bug

End Sub

Sub connectCLUBS

Connection.New1
Command.New1("", connection.Value)
Connection.Open("Data Source = " & AppPath & "\CLUBS.DB")

End Sub



Sub iftablenotexist

command.CommandText = " SELECT name FROM sqlite_master WHERE type = 'table' AND name = 'TEM20082009'"
Reader.New1
Reader.Value = command.ExecuteReader
If Reader.ReadNextRow= True Then
label10.Color=cGreen
label10.Text="CONECTADO..."
Reader.Close
Else
label10.color=cRed
label10.Text="NO CONECTADO..."
Reader.Close
End If
End Sub


In this part of the code, no error appears


If combobox4.Item (combobox4.SelectedIndex)="DptivoCoruña" Then
Image1.LoadPicture ("icon\Deportivo.png")
End If
If combobox7.Item (combobox7.SelectedIndex)="DptivoCoruña" Then
Image2.LoadPicture ("icon\Deportivo.png")
End If

works perfectly. For this reason, I find it strange that not open the database.

Gracias y un saludo
Oscar
 

Maki25

Member
Licensed User
Longtime User
It is very strange, maybe if I see the code I would be able to help more. The error message is thrown from somewhere below, so it is not very helpful alone in this case. Did you try to add some msgboxes to see important vars?

Hi,

I chose to put msgbox everywhere.
My conclusion is that this part of the code does not work after compiling

Command.New1 ( "", connection.Value)

I've moved, and seems to always stop in this part of the code. If I delete this part of the code itself connects to the database, but of course, the error appears undeclared command object.

If you can help me understand, I appreciate it.
 
Last edited:

Maki25

Member
Licensed User
Longtime User
Hello again,

I think I know which is the problem;

When I am editing the program, for objects Connect, Command and Reader, I use SQLDesktop.dll and SQLDevice.dll. Then it compiles, and creates a file called System.Data.SQLite.dll.
I tried changing the file and use sqlDESKTOP SQLDevice by System.Data.SQLite.dll. I created the objects SQLiteCommand, sqliteconnect and sqliteReader, and the result is that when it reaches the code Command.New1 ( "", connection.Value), I get an error saying that the chain code is wrong or bad constructed. This error without compiling.

If I use SQLDevice.dll and SQLDescktop.dll files to edit, compile folder these files have to appear, and not the file called System.Data.SQLite.dll.

It is clear that the failure is due to file System.Data.SQLite.dll ... do not know how to fix it.:BangHead::BangHead::BangHead:
 

Maki25

Member
Licensed User
Longtime User
Con la nueva versión 6.8 funciona mu bien, ahora no tengo problemas.:sign0060::icon_clap:

Gracias a todos
:)
 
Top