![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi everybody,
I have to add a number of fields to a table if those fields do not already exist. I have been playing around with IF NOT EXISTS, but I don't get it working. Also, I have no idea how to intercept error messages from SQlite; then I could just ignore certain error codes, a.o the error if a field already exists. With VB I have done quite complicated things with SQL; may be that the problem is that I try to do it in the same way. Are there some SQLite experts among the forum members? Harry |
|
||||
|
I'm not a SQLite expert.
Also try sqlite site: http://www.sqlite.org/support.html For now it is not possible to catch error messages with the ErrorLabel method. It is high in the ToDo list and will be available in the near future. |
|
|||
|
I am definitely no SQLite expert either!
However a simple method could be - do a SELECT * on the table and open it with DataReader, then use FieldCount to test if the fields exist. Finally do ALTER TABLE with an ExecuteNonQuery, if needed. Alternatively, if you need more column information, use ExecuteTable instead, then the Table control's ColCount and ColName properties. Just a suggestion. Geoff. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| A few questions regarding FormLib | N1c0_ds | Questions & Help Needed | 6 | 09-19-2008 03:34 AM |
| Newbie Questions | Bruno | Questions & Help Needed | 2 | 05-05-2008 07:45 PM |
| Questions on SpecialKeys | HARRY | Questions & Help Needed | 5 | 02-26-2008 02:55 PM |
| One of my stupid questions.... | Cableguy | Questions & Help Needed | 7 | 01-27-2008 11:26 AM |
| SQL Questions | tcgoh | Questions & Help Needed | 7 | 12-31-2007 10:10 AM |