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

Go Back   Android Development Forum - Basic4android > Basic4ppc (Windows Mobile) > Questions (Windows Mobile)
Documentation Wiki Register Members List B4P Search Today's Posts Mark Forums Read

Questions (Windows Mobile) Post any question regarding Basic4ppc.

Some questions

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-13-2008, 04:16 PM
Junior Member
 
Join Date: Dec 2008
Posts: 14
Default Some questions

Hello,

i have download the trial version to take a look of basic4ppc.
Now i have as a newbie at this time two questions:

- can i call from the main application a form from a module ?
what is the syntax to do this ?

- is there a possibility to work with tables that can have one ore more
indexes ?

- how can i search for a record using a index

i use it for a application with more than 10.000 records and need speed.

kind regards from germany
Reply With Quote
  #2 (permalink)  
Old 12-13-2008, 04:23 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Hi and welcome to Basic4ppc.
- Yes. For example if we have a module named 'Module1' and a form named 'Form1':
Code:
Module1.Form1.Show
- Basic4ppc supports SQLite tables.
You can create any number of indexes in one table.
- Searching is done with a SELECT query.
The SQL language may look a little bit complex at the beginning however simple queries can be created very easily.
Here is a useful tutorial: SQL Tutorial
__________________
Basic4android documentation
Reply With Quote
  #3 (permalink)  
Old 12-14-2008, 03:40 PM
Junior Member
 
Join Date: Dec 2008
Posts: 14
Default more questiens

Thanks,
i have try to create a table like this

CREATE DATABASE MDEdb
CREATE TABLE ScanData
( Nummer Int Not NULL UNIQUE,
EAN varchar(13) UNIQUE,
Name varchar(30),
Groesse varchar(10),
Einheit varchar(4)
Bisher Int,
Menge Int
)
but i get comiler error ??

how can i find a list of datatype-names

kind regards
Reply With Quote
  #4 (permalink)  
Old 12-14-2008, 04:39 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

Can you post the actual code?
What compiler error do you get?
Which version of Basic4ppc do you use?

SQLite documentation: SQLite Documentation
__________________
Basic4android documentation
Reply With Quote
  #5 (permalink)  
Old 12-15-2008, 05:56 AM
Junior Member
 
Join Date: Dec 2008
Posts: 14
Default

Hallo Erel,

the version is 6.50

the code , see last mail

the compiler error was "inavlid Number of parenthesis"
for the line with the first Field-def

kind regards
Reply With Quote
  #6 (permalink)  
Old 12-15-2008, 08:50 AM
Basic4ppc Veteran
 
Join Date: Feb 2008
Location: Hilversum, The Netherlands
Posts: 295
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Code:
CREATE DATABASE MDEdb

    CREATE TABLE ScanData
        (    Nummer  
Int         Not NULL UNIQUE,
             EAN     varchar(
13)    UNIQUE,
            Name    varchar(
30),
            Groesse    varchar(
10),
            Einheit    varchar(
4)
            Bisher    
Int,
            Menge    
Int
        )
I think the problem lies with the "Create DB" command
The DB will be created automatically if the SQLite db cannot be found.

Personally I always create a DB with another (visual) SQLite manager
and then I don't need to sc**w around with the above commands.


Good Luck
Reply With Quote
  #7 (permalink)  
Old 12-15-2008, 02:28 PM
Junior Member
 
Join Date: Dec 2008
Posts: 14
Default

the problem is compiling the code
the compiler gives a error message "invalid number of parenthesis"
Reply With Quote
  #8 (permalink)  
Old 12-17-2008, 01:33 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

A string can't include more than a single line.
You only posted your SQL code so I'm not sure if that is the problem, or not.
A multiline string should be built with the concatenation character.
__________________
Basic4android documentation
Reply With Quote
  #9 (permalink)  
Old 12-17-2008, 04:25 PM
Junior Member
 
Join Date: Dec 2008
Posts: 14
Default

Hi Erel,

that is the complete Code. Sorry, but i don't understand what you say.
when id do it in one line i get a normal syntax error.
what is the correct syntax to create a table, i don't found a example.

Sub Form1_Show
'create the Database and table
CREATE DATABASE MDEdb
CREATE TABLE MDEdb.ScanData
( Nummer Int Not NULL UNIQUE,
EAN varchar(13) UNIQUE,
Name varchar(30),
Groesse Real,
Einheit varchar(4),
Bisher Int,
Menge Int
)
End Sub


kind regards
Reply With Quote
  #10 (permalink)  
Old 12-18-2008, 07:41 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 13,162
Awards Showcase
Basic4ppc Founder 
Total Awards: 1
Default

You are confusing between Basic4ppc language and SQL language.
The way to work with SQL queries is to build a string that holds the query and then pass this string to a SQL Command object.

The first steps that are required when working with the SQL library are:
- Add a reference to SQLDesktop.dll and SQLDevice.dll.
- Add a Connection object and a Command object.
This is the code that builds your table (the program is attached):
Code:
Sub Globals
    
'Declare the global variables here.

End Sub

Sub App_Start
    connection.New1
    connection.Open(
"Data Source = " & AppPath & "\myDb.db")
    command.New1(
"",connection.Value)
    CreateTable
    
    
'Show the table
    command.CommandText = "SELECT * FROM ScanData"
    command.ExecuteTable(
"table1",0)
    form1.Show
End Sub

Sub CreateTable
    command.CommandText = _
        
"CREATE TABLE IF NOT EXISTS ScanData " & _
        
"( Nummer Int Not NULL UNIQUE, " & _
        
"EAN varchar(13) UNIQUE, " & _
        
"Name varchar(30), " & _
        
"Groesse Real, " & _
        
"Einheit varchar(4), " & _
        
"Bisher Int, " & _
        
"Menge Int " & _
        
")"
    command.ExecuteNonQuery
End Sub
__________________
Basic4android documentation
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
Newbie Questions Bruno Questions (Windows Mobile) 2 05-05-2008 07:45 PM
Questions on SpecialKeys HARRY Questions (Windows Mobile) 5 02-26-2008 02:55 PM
One of my stupid questions.... Cableguy Questions (Windows Mobile) 7 01-27-2008 11:26 AM
More SQL questions HARRY Questions (Windows Mobile) 2 01-04-2008 11:15 AM
SQL Questions tcgoh Questions (Windows Mobile) 7 12-31-2007 10:10 AM


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


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