Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Losing AppPath


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-25-2008, 04:49 PM
Senior Member
 
Join Date: Jul 2007
Posts: 147
Awards Showcase
Beta Tester 
Total Awards: 1
Default Losing AppPath

On my ppc my program fires up and runs fine until I start up another program. It looks like the other app resets the apppath and when I go back to my program it doesn't see the database anymore. The only way to get it going again is to shut down my program and restart it and all is well again. My question is can I use something other than apppath to tell my program where to find the database?


This is what I'm using now.

con.New1
con.Open("Data Source = " & AppPath & "\MyData1.sl3")
cmd.New1("",con.Value)
cmd.ExecuteNonQuery

My program, dll's, and data file are all on my storage card in a folder.

Thanks in addvance for the help.

P.s. Or point me in the right direction. Thank You
__________________
Using 6.30
dennishea
Reply With Quote
  #2 (permalink)  
Old 03-25-2008, 05:02 PM
agraham's Avatar
Basic4ppc Expert
 
Join Date: Jul 2007
Location: Cheshire, UK
Posts: 1,770
Awards Showcase
Beta Tester Forum Contributer 
Total Awards: 2
Default

Quote:
Originally Posted by dennishea View Post
It looks like the other app resets the apppath
I don't think it can. I believe that the AppPath is read when an app starts and is stored internally as a string thereafter so I don't think that anything external could alter that.

Are we talking about any other program or just a particular one. Are any errors produced and if so which one(s)? Is the database maintained open during this time or does it fail on opening after this other program is started?

More info about exactly what is happening is needed I'm afraid!
Reply With Quote
  #3 (permalink)  
Old 03-25-2008, 06:15 PM
Senior Member
 
Join Date: Jul 2007
Posts: 147
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Are we talking about any other program or just a particular one. Are any errors produced and if so which one(s)? Is the database maintained open during this time or does it fail on opening after this other program is started?


Hi agraham.

1)
Normally any windows programs.
2)
It says sqlite error No such table: workdata or :cams depending on which table I'm opening at that moment.
3)
As long as my program isn't shut down yes it is still open. I don't do con.close until the program is closed.
4)
I have two tables I add to and subtract from. I use this type of code to read the data base .

cmbCam.Clear
reader.New1
cmd.CommandText = "Select Internal FROM Cams ORDER BY Internal"
Reader.Value = cmd.ExecuteReader
Do While reader.ReadNextRow = True
cmbCam.Add(reader.GetValue(0))
Loop
Reader.Close

They normally fail after the other program(s) have been run. At that point a simple restart allows it read again. If any of my statements aren't politically correct like my spelling, forgive me. I'm hoping to learn from the people in this forum and I am a slow learner.



edit: I'm not sure what's going on I just tried to duplicate what I stated above and now it won't do it. It has been doing it right along for the last week or so. I have been trying to shrink my code the last two or three days and it problably was something wrong with my code and I inadverently corrected it. Time will tell.
__________________
Using 6.30
dennishea

Last edited by dennishea : 03-25-2008 at 06:55 PM.
Reply With Quote
  #4 (permalink)  
Old 03-25-2008, 07:12 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

I don't believe that AppPath changes.
You can easily check it with a simple Msgbox(AppPath).
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Designer problem - losing a Form agraham Beta Versions 1 10-12-2008 07:36 PM
Not losing cursor position after running/compiling Woinowski Basic4ppc Wishlist 0 01-16-2008 08:18 AM


All times are GMT. The time now is 02:24 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0