I'm having trouble replying in outlook. Sorry if multiple posts
or emails show up.
Here is an example I came up with:
1) Connect to database and get table description
dbc := (DBConnection new) dsn: 'ConstraintsDB'; connect.
xx := dbc tables.
xx := dbc columns: 'tblLetterType'.
" a DBColAttr(1, LetterTypeId, SQLInteger, 4) "
" a DBColAttr(2, LetterType, SQLVarChar, 100) "
" a DBColAttr(3, Description, SQLVarChar, 100) "
2) Prepare an insert statement.
insertStatement := dbc prepare: 'insert into tblLetterType (LetterTypeId,
LetterType, Description) values (?, ?, ?)'.
insertStatement paramCols: ((dbc columns: 'tblLetterType') asArray).
3) Insert rows with the statement.
insertStatement values: #( 99 'aaa' 'bbb').
insertStatement exec.
insertStatement values: #( 100 'ccc' 'ddd').
insertStatement exec.
4) Check that the new rows are there.
rs := dbc query: 'select * from tblLetterType where LetterTypeId >= 99'.
5) Marvel at how much easier this was than using VisualC++. (I use Visual
Studio at work)
"Craig H. Anderson" <
[hidden email]> wrote in message
news:1imR5.207761$
[hidden email]...
> How can one add rows to an empty
> database with the database package?
>
> Thanks
>
>
>