Download the free trial version
Basic4android Video
Features
Tutorials and manuals
Showcase
Screenshots

Go Back   Android Development Forum - Basic4android > Foreign Languages > Spanish Forum
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

DataBase sqlite problem after compiler

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-03-2009, 02:00 AM
Junior Member
 
Join Date: Sep 2009
Posts: 32
Unhappy DataBase sqlite problem after compiler

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 ..
Reply With Quote
  #2 (permalink)  
Old 11-03-2009, 05:51 AM
Ariel_Z's Avatar
Basic4ppc Veteran
 
Join Date: May 2009
Posts: 246
Default

Could you post the source code (better all of it, but you can post just the part causing the problem)?
Reply With Quote
  #3 (permalink)  
Old 11-03-2009, 06:28 PM
Junior Member
 
Join Date: Sep 2009
Posts: 32
Default

Quote:
Originally Posted by Ariel_Z View Post
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

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
Reply With Quote
  #4 (permalink)  
Old 11-03-2009, 07:11 PM
Ariel_Z's Avatar
Basic4ppc Veteran
 
Join Date: May 2009
Posts: 246
Default

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?
Reply With Quote
  #5 (permalink)  
Old 11-03-2009, 11:29 PM
Junior Member
 
Join Date: Sep 2009
Posts: 32
Default

Quote:
Originally Posted by Ariel_Z View Post
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
Reply With Quote
  #6 (permalink)  
Old 11-04-2009, 11:03 PM
Junior Member
 
Join Date: Sep 2009
Posts: 32
Default

Quote:
Originally Posted by Ariel_Z View Post
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 by Maki25 : 11-04-2009 at 11:11 PM.
Reply With Quote
  #7 (permalink)  
Old 11-04-2009, 11:56 PM
Junior Member
 
Join Date: Sep 2009
Posts: 32
Default

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.
Reply With Quote
  #8 (permalink)  
Old 11-07-2009, 12:20 AM
Junior Member
 
Join Date: Sep 2009
Posts: 32
Default

Con la nueva versión 6.8 funciona mu bien, ahora no tengo problemas.

Gracias a todos
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Array keyword compiler problem agraham Beta Versions 2 08-29-2008 09:25 AM
Graphic in SQLite Database Picard Questions (Windows Mobile) 1 08-23-2008 12:03 PM
Date save as zero (0) in the SQLite database mozaharul Questions (Windows Mobile) 2 04-02-2008 10:25 AM
Problem with Optimized Compiler mikemputer Questions (Windows Mobile) 3 01-26-2008 03:00 PM
How to convert an Access database to a sqlite database Peter Code Samples & Tips 5 07-24-2007 04:20 PM


All times are GMT. The time now is 04:20 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0