New to basic4android and need Database information

CD Tom

Member
Licensed User
Longtime User
I have been using MS Access for many years so I know a little about databases. I very new to android programming and need help. I'm trying to create a program that I can import data from my MS Access database into an android app that will allow my to search for an individual and display some information. I don't have any idea where to start, I see lots of tutorials on the forum, is there a tutorial that would show my how to set up a database and load it with data from my Access database.
Thanks for any help.
 

Mahares

Expert
Licensed User
Longtime User
Attached is a zipped running project. I tested it on a Nexus 7 like yours.
1. It creates the database and the table if it they do not exist when you click on the LOAD new DB button.
2. Then it populates the last name spinner with the last names of the members.
3. If you click the button again and the table has records, it will show you the number of records and ask you if you want to overwrite them. If you overwrite, then it will delete the old data and loads the new file into the table and populates the last name spinner. If not, it will populate the spinner.
4. The path for the database in the Nexus 7 is: Android\data\b4a.examplecdtom\files\Members.db.
This will get you started and going.
 

Attachments

  • TestProjectCDTom010713.zip
    165.7 KB · Views: 210
Upvote 0

CD Tom

Member
Licensed User
Longtime User
That works great, I am able to select the members name from the spinner and display the information. Is there a way to show both the last name and then the first name in the spinner. Seeing that there can be many with the same last name, it would be easier to show both.
Thanks, I can see where case makes a big difference. I found that out in displaying information.
 
Upvote 0

CD Tom

Member
Licensed User
Longtime User
Now that I have it sort of working I see where I need to do things differently. In access I can have a drop down list that when I type in it I jump to the place in the list , is there something like that in b4a? Also because there are many members with the same last name I will need to look them up by their member number. Again in access I can display information in the drop down list and hide the lookup column, so the drop down list would have member number, last name, first name and only show last name and first name but when selected would lookup the person by their member number.
I hope I'm not being to much of a pain with all my questions?
 
Upvote 0
Top