Android Tutorial New Easy to Use DataBase Functions V1.0 with Samples

margret

Well-Known Member
Licensed User
Longtime User
Easy To Use DataBase Version 1.5

Update – Easy To Use DataBase Version 1.5 Coming Soon – Friday August 12th, 2011

New in Version 1.5 is a callback function for subs to more completely automate your programming task and again requires less user code. This new version will include a full working program demo. The demo program will have full working code of each feature using multiple database file structures. New callback functions are listed below:

ClearFields
PutFields
GetFields

Thanks,

Margret
 
Last edited:

margret

Well-Known Member
Licensed User
Longtime User
The New Easy DataBase V1.5

JUST POSTED - The New Easy DataBase V1.5 Functions with Samples and Full Working App are Attached to Post #1 - August 14th, 2011 3:29 PM

Just added is Version 1.5 of Easy DataBase Functions with full working App Code! The Easy DataBase functions and sample code are now attached to post #1. The ADR.DataBaseProgram_1.5.zip is a full working app to show how to implement the db. Functions in code. Also, the new version 1.5 handles not only the db.Pointer for you as well as BOF, EOF, No records as the previous version did, but also handles DataBase does not exist. Version 1.5 has three new callback subs that are listed below.

____________________________________________________________________

NEW: The following are main module subs that can be used to automate the assignment of Edittext and fields in your program. Version 1.5 now
calls back to these subs, if they exist.

B4X:
ClearFields        ‘Sub to clear Edittext values

GetFields          ‘Sub to assign fields values to Edittext

PutFields          ‘Sub to assign Edittext values to fields
____________________________________________________________________


Download is posted here: http://www.b4x.com/forum/basic4android-getting-started-tutorials/10553-new-easy-use-database-functions-v1-0-samples.html

Thanks,

Margret
 
Last edited:

wjones

New Member
Licensed User
Longtime User
Hi all, sorry im kinda new to B4A but have just started using margrets DB files and am having a little Issue. Below is my code.

Sub ListView1_ItemLongClick (Position As Int, Value As Object)
Dim srch As String
srch = value
db.FindRecord(srch) 'Find the record
Msgbox(db.Field(0,0)&CRLF&db.Field(1,0),"Search Results") 'Search ALL Fields in the datafile for match, it is not case sensitive
Activity.Title = srch
End Sub

The problem is I cant get the messagebox to display the results of "srch" the activity title updates corrects and displays the corrects data, Can i not use db.FindRecord(srch) The examples show db.FindRecord("Texttosearchfor") but obviously if i use ""s then it would search for that text and not the srch text. I hope this makes sense to someone I've tried for a while now to get it going. Appreciate the help.

btw thank you SO much for this margret i was dreading learning the database part, but you've made it a breeze!
 
Last edited:

wjones

New Member
Licensed User
Longtime User
:signOops: Nevermind it was my code that was wrong, sorry still getting used to this, it's been a while since i've used VB. :sign0104:

Thanks again for your code. Its fantastic. cant thank you enough. :sign0188: :sign0089:
 

netchicken

Active Member
Licensed User
Longtime User

margret

Well-Known Member
Licensed User
Longtime User
Date functions


Sounds like a good idea. I'll look into it, I'm sure I can come up with something.

Margret
 

splatt

Active Member
Licensed User
Longtime User
File format

Hi Margaret,

Your db module looks excellent.

Are fields delimited in anyway when they are stored in the db file?

Are fields enclosed in quotes and comma separated, with a new line for each record?

I have a couple of large datasets to test.
 

margret

Well-Known Member
Licensed User
Longtime User
Database Structure

Hi Margaret,

1..Are fields delimited in anyway when they are stored in the db file?

2..Are fields enclosed in quotes and comma separated, with a new line for each record?

Hello,

The answers are as follows:

1..The fields are not delimited at all

2..The fields are not in quotes or separated with any character, and yes, there is a new line for each record. In a text editor it would look like below for the following data:

Jim Smith-25 spaces long
2789 West Drive-25 spaces long
Atlanta, GA 37341-25 spaces long
(706) 892-0938-14 spaces long

B4X:
Jim Smith                2789 West Drive          Atlanta, GA 37341        (706) 892-0938


Thanks,

Margret
 

morecrabs

Member
Licensed User
Longtime User
Would like to give u an idea for the module, perhaps its already there and I don't understand some of the functions but a method for sorting all unique entries within a field column..

Used to program vb6 as a hobbist.... been. A few years and found your module really useful for torwards remebering how, keep up the good work and thanx..
 

margret

Well-Known Member
Licensed User
Longtime User
Hello and thank you. It does this already! You define the fields in the order you want. It indexes on the Field1 + Field2 + Field3, etc. Just list the structure of your database in the order you want them sorted. I have six apps I am updating and then I plan on doing some more work on the database module.

Margret
 

morecrabs

Member
Licensed User
Longtime User
Actually I was refering to during the query process, to search for all unique entrys ie a column containing a series of city names

(detroit, Montreal,windsor,chicago,detroit,windsor)

And have the query return

Detroit, Montreal, windsor, chicago

Orrder isn't as important as elimation of dupicates or did I further misunderstand your explainnation?

If it does this already could you point me in the correct direction?

Thanx again and sorry for my ignorance
 

mleffler

Member
Licensed User
Longtime User
Possbile feature for library.

I like your library and am using it a lot.

One thing missing that I use often is a timestamp on the record. Almost all records I store in a database are going to need a timestamp. Most of my work involves either storing data on a group of devices over time or seeing the change in readings of one device over time.

I created a sub to do that for my code but I imagine others would want that also.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…