PDA

View Full Version : Wrong direction


csd214
08-20-2004, 10:43 AM
I have tried to study the SQLite plugin (from previous experience I know the strength of SQL queries). The first step was to create some tables (from text files). By means of the plug-in help file, I succeeded with an user defined function easy to use. Then I wanted to display a specific row, let's say number 215. It’s like “going to Sweden” when you “live in Norway” – then you have to go eastwards.

I started with a SQL Query "select * from "..cTable; (selected all rows!). Continued with SQLite.Compile(), then SQLite.Query() with CallBack Function with tbRowDataArray where I tested for nRow == nPrm. OK, I came to Sweden, but afterwards I discovered that I had went west, passed Rankin Inlet on my way round the world, until I arrived in Sweden.

This is more efficient:
sql="select * from "..cTable.." where rowid = "..nPrm;
tblRec = SQLite.QueryToTable(db, sql);
IN tblRec I HAVE ALL WHAT I NEED!

When I started with AMS, “tables” was an important issue. I read the docs, and tried again. Read the docs, and tried again. Not until I had played through Coreys CD#3 “Tables Made Easy”, the idea was clear.

Why these words? To tell that I miss the Plug-In CD with “SQLite Databases Made Easy”. I still miss my early morning lessons with “Corey on my ear”, but this forum supplies the want.

Intrigued
08-20-2004, 12:23 PM
I have tried to study the SQLite plugin (from previous experience I know the strength of SQL queries). The first step was to create some tables (from text files). By means of the plug-in help file, I succeeded with an user defined function easy to use. Then I wanted to display a specific row, let's say number 215. It’s like “going to Sweden” when you “live in Norway” – then you have to go eastwards.

I started with a SQL Query "select * from "..cTable; (selected all rows!). Continued with SQLite.Compile(), then SQLite.Query() with CallBack Function with tbRowDataArray where I tested for nRow == nPrm. OK, I came to Sweden, but afterwards I discovered that I had went west, passed Rankin Inlet on my way round the world, until I arrived in Sweden.

This is more efficient:
sql="select * from "..cTable.." where rowid = "..nPrm;
tblRec = SQLite.QueryToTable(db, sql);
IN tblRec I HAVE ALL WHAT I NEED!

When I started with AMS, “tables” was an important issue. I read the docs, and tried again. Read the docs, and tried again. Not until I had played through Coreys CD#3 “Tables Made Easy”, the idea was clear.

Why these words? To tell that I miss the Plug-In CD with “SQLite Databases Made Easy”. I still miss my early morning lessons with “Corey on my ear”, but this forum supplies the want.

I would buy Speedy Training - SQLite - volume 4 in a heart beat!

Worm helped me yet again on a SQLite query. If this keeps up I will have to put Worm on retainer!

What I was trying to accomplish was that I wanted to have only one instance of a last name in a Listbox Object. So, I was ding like you and "select * from TABLENAMEHERE" routine.

I spent several hours with no workable solution. Finally I messaged Worm and asked him how to delete the duplicate last names that are populating my Listbox (on more than one page).

Worm replied within five minutes (wow) and he had one line of code to offer. I looked it over and sure enough it worked. As a matter of fact it just replaced one character with two words!

Here is the line that works:

tblRecords = SQLite.QueryToTable(customerdb, "Select Distinct lastname from CUSTOMERS");

I had:

tblRecords = SQLite.QuerytoTable(customerdb, "Select * From CUSTOMERS");

Worm, your one heck of a guy! Thanks again!

Very Sincerely,